the useEffect function allows you to return a function that gets called when a component unmounts. you could use that or call something when the tab changes.


The CountDown component manages the timer itself and the library author manage to clear the timer when the component unmount

Related Query

More Query from same tag