setInterval timer with state setter
Im using a setInterval as a countdown timer and there is state being set within to display the timer. Would i need to stick this setInterval within a useEffect with a empty dependency to make sure it only runs once? Or is there a better way to do this?
2 Replies
Surely if the target date is static then it doesn't matter if the component gets displayed again, it will still display the correct countdown time
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View