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