~/talk

Breaking the useEffect Habit

Talkat UtahJS Conf 2023 · on Friday, 2023-09-15· [react]
slides:none on file

Argues that most useEffect calls are unnecessary and should be reserved for syncing things outside React, cites a Facebook audit finding 30% of effects were wrong or redundant, and shows concrete replacements: using useMemo for cached calculations, using keys to remount to reset component state, moving network work to TanStack or into event handlers, and pulling logic into plain variables or functions. Examples rerun less, reduce renders, and simplify code in live demos.

AI-written summary · about

  1. 0:00Introduction
  2. 2:55What is useEffect?
  3. 6:49Why avoid useEffect?
  4. 10:20When to use useEffect
  5. 11:03Updating state with useEffect
  6. 13:58Caching calculations
  7. 16:23Resetting state
  8. 20:40Sharing event logic
  9. 21:44Sending post requests
  10. 22:26Chaining useEffects
  11. 23:29Summary and takeaways
~/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.