Why I Stopped Using useEffect to Sync State (opens in new tab)
Why I Stopped Using useEffect to Sync State — and What I Use Instead I made a mistake that, I suspect, most teams working with React are still making today: I used useEffect as a general-purpose state synchronization tool. If something changed and I wanted to react to it, there was the effect. Clean, familiar, and — I figured this out way too late — completely wrong for most of those cases. I'm not telling you this to flagellate myself. I'm telling you because when I systematically audited th...
Read the original article