Cannot Reset Time with key
See original GitHub issueHello,
I tried to reset the time with changing the key whenever the timer completed. But, the timer did not reset at all.
it works when i used the timer in the modal, but failed when i do it in a single page.
<Countdown date={startDate.current + 5000} key={reset} onComplete={() => setReset(prev => prev + 1)} renderer={({ formatted, completed }) => { if (completed) { return ( <span className={classes.hyperlink} onClick={e => { e.preventDefault(); setReset(reset + 1); }}> ReSend </span> ); } else { return ( <span> <b> {formatted.minutes}:{formatted.seconds} </b> </span> ); } }} />
Im using Nextjs for development any help? thanks
Issue Analytics
- State:
- Created a year ago
- Comments:8
The Modal’s flag. y’know, the
open={flag}
I have to check it again.