Member-only story
React: useEffect mistakes, beginner friendly
Every React developer, myself included, has a complex relationship with the useEffect hook. We call it “useEffect.” It’s our incredibly helpful friend — it handles all the messy, “side effect” tasks: talking to APIs, setting up timers, and adjusting the browser title.
If you don’t give it crystal-clear instructions, it’ll panic, cause chaos, and maybe even crash your app.
You can either setup a small react app or use this to get your hands dirty.
Reat this article for free — https://medium.com/@akshaysen/react-useeffect-mistakes-beginner-friendly-c791ca408d74?sk=200a1a861d5f793af5e8b4cca15f9072
Chapter 1: The Instruction Manual — The Dependency Array
The useEffect hook follows one golden rule: “I only do the work you ask for when the things on my instruction manual change.” That “instruction manual” is the dependency array.
Mistake 1. Forgetting the Dependency Array
When you write a function for useEffect and forget its dependency array, it assumes it has to run after every single…






