Good job on completing this challenge.
The only detail or "problem" I see is that the timer starts two seconds less than the set time. I think maybe it's because of the interval in the code or I don't know if you used it inside a useEffect, but again this is an amazing job. Keep it up !
@josemongedev
Posted
@SebastianDev-Vue Thanks, yeah I noticed that as well, and I did use useEffect hook(which is async) with setInterval(sync) inside.The hook clears the interval ID to avoid creating a new interval every time a variable in the dependency list changes, but it's slow at the start when the setup is done. I tried using useLayoutEffect, but got worse results. Hmm I need to think about it more and maybe refactor it, thanks for the tip anyway!