DEV Community

[Comment from a deleted post]
Collapse
 
muhfaridzia profile image
Muhammad Farid Zia

Yaps, your code work, but your second useEffect will run every render because you omit deps, that's the problem.

reactjs.org/docs/hooks-effect.html...

 
gautham495 profile image
Gautham Vijayan

Naa bro! It works, You can go and check my project's console