~/talk

Goodbye, useEffect

Talkat Reactathon 2022 · 2022-05-03..05-05· [react, frontend-architecture]
slides:none on file

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

  1. 0:00The problem with use effect
  2. 2:21Lifecycle vs synchronization
  3. 3:47Avoiding common foot guns
  4. 6:07Imperative vs declarative
  5. 7:51Strict mode and effects
  6. 9:40Synchronizing vs action
  7. 11:15Event handlers as the answer
  8. 13:57State machines for orchestration
  9. 17:50External stores and patterns
  10. 22:24Conclusion and best practices
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.