react-use-count-down
react-use-count-down copied to clipboard
requestAnimationFrame causes a weird UI
If you leave the page in another tab, browse in another tab, wait some time then come back to the tab with the Countdown, notice the countdown tried to countdown fast to fill in the missing time when you were away in another tab.
It happens with the demo also: https://stackblitz.com/edit/react-use-count-down?file=index.js
Could we cancel the animation frame when users navigate away from the current tab?