You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally you had useEffect(() => { setTime(new Date()) }, [new Date().getMinutes()])
The fix I tried on my own project is useEffect(() => { const interval = setInterval(() => { setTime(new Date()); }, 1000); return () => clearInterval(interval); }, []);
Please let me know if I can contribute this piece of code I'm new to GitHub and I'm trying to build my profile contributes thank you and have a great day!
The text was updated successfully, but these errors were encountered:
Originally you had
useEffect(() => { setTime(new Date()) }, [new Date().getMinutes()])
The fix I tried on my own project is
useEffect(() => { const interval = setInterval(() => { setTime(new Date()); }, 1000); return () => clearInterval(interval); }, []);
Please let me know if I can contribute this piece of code I'm new to GitHub and I'm trying to build my profile contributes thank you and have a great day!
The text was updated successfully, but these errors were encountered: