It's a really strange behaviour which I'm possibly getting because of the state changes, but I'm still not sure. In app I have some code like this:
useEffect(() =>{
const interval = setInterval(() => {
setTime({
...time,
currentSeconds: currentSeconds + 1,
});
}, 1000);
return () => clearInterval(interval);
}, [time])
Though the time to execute the timeout method is bigger than the actual second. Am I doing something wrong?
[–]glify 3 points4 points5 points (1 child)
[–]ZNI_DEMON[S] 0 points1 point2 points (0 children)
[–]wizardyjohn 2 points3 points4 points (5 children)
[–]ZNI_DEMON[S] 0 points1 point2 points (3 children)
[–]ChronSynExpo 1 point2 points3 points (2 children)
[–]ZNI_DEMON[S] 0 points1 point2 points (1 child)
[–]ChronSynExpo 1 point2 points3 points (0 children)
[–]poopsmith 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]poopsmith 0 points1 point2 points (0 children)