Why Your React useEffect Cleanup Function Isn't Running (The Dependency Array Gotcha) You add a cleanup function to your useEffect . You expect it to run when the component unmounts, or when a dependency changes before the effect re-runs. You test it. Nothing happens. No console log, no unsubscribe, no cleared interval — just silence, and a bug report from a user seeing duplicate event listeners or a memory leak that grows worse the longer they use your app. If you've hit this, you're no...