Goodbye, useEffect
summary
Argues that useEffect is commonly misused and should be limited to useEffect for synchronization; one-off “action” effects belong in event handlers or, better, in state transitions so effects are declared on transitions and executed by a store. Calls out React 18 Strict Mode double-invoke as a footgun, recommends using state machines/statecharts (Stately / XState) or useExternalStore to run effects, shows ref-flag and Suspense for fetch-on-render as practical patterns.
AI-written summary · about
chapters (10)
- 0:00The problem with use effect
- 2:21Lifecycle vs synchronization
- 3:47Avoiding common foot guns
- 6:07Imperative vs declarative
- 7:51Strict mode and effects
- 9:40Synchronizing vs action
- 11:15Event handlers as the answer
- 13:57State machines for orchestration
- 17:50External stores and patterns
- 22:24Conclusion and best practices








