Skip to content

When I know two countdowns on the same page countdown the two have the same value error #10

@AhmadAl-Ghalban

Description

@AhmadAl-Ghalban

When I know two countdowns on the same page and useRef defines a different countdown the two have the same value
code
const countdownDareRef = useRef();
const countdownRef = useRef(null);
code 1
<Countdown
ref={countdownRef}
style={styles.timer}
textStyle={{ fontSize: 20, color: '#fff', textAlign: 'center' }}
initialSeconds={onEnd ? 1 : duration / 1000}
formatTime="hh:mm:ss"
autoStart={true}
onEnd={() => {
if (duration / 1000 < 0) {
console.log('End', duration)

                            }
                        }}

                    />

code 2
<Countdown
ref={countdownDareRef}
textStyle={{ fontSize: 20, color: '#fff', textAlign: 'center' }}
initialSeconds={300}
formatTime="hh:mm:ss"
autoStart={false}
onEnd={() => { }}

                    />

To Code Teak same initialSeconds but I need different initialSeconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions