~/talk

Adiós, useEffect: Managing Effects More Effectively

Talkat React Alicante 2022 · 2022-09-29..10-01· [react, developer-experience]
slides:none on file

Argues useEffect often misleads: runs effects twice on mount in react 18 strict mode, causing surprising re‑runs and infinite loops. Recommends moving fire‑and‑forget work into event handlers, using use sync external store for subscriptions, modeling effects as state transitions with state machines, and adopting render as you fetch or tools like react query / Remix for data. Shows concrete code patterns and a video demo that replace messy dependency arrays with predictable, testable synchronization.

AI-written summary · about

  1. 0:00Managing effects in React
  2. 1:11Why developers struggle
  3. 2:56Core problem with useEffect
  4. 4:44Sync vs lifecycle
  5. 5:45Infinite loops pitfalls
  6. 7:53Flawed dependency array
  7. 10:02React 18 double execution
  8. 11:46Synchronized effects
  9. 14:34Where effects belong
  10. 16:42Effects in state transitions
  11. 18:28When you don't need useEffect
  12. 20:57Transforming data without useEffect
  13. 22:22Parent communication without useEffect
  14. 24:26Subscribing to external stores
  15. 26:54Declarative effects with state machines
  16. 30:07Demo: state machine effects
  17. 33:16Advanced state machine logic
  18. 36:10Fetching data without useEffect
  19. 39:18Problems with useEffect for data fetching
  20. 40:45Initializing singletons
  21. 41:46Effective effect management
~/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.