I have the problem that the interval I am using in useEffect isn't stopping when leaving the component.
The code is:
useEffect(() => {
const timer = window.setInterval(() => {
refreshSave();
}, 3000);
return () => {
window.clearInterval(timer);
};
}, []);
I am thinking about animating an empty span and then using onAnimationIteration to trigger the save.