~/talk

React Hook Pitfalls

Talkat React Rally 2019 · 2019-08-22..08-23· [react, testing]
slides:none on file

Covers five pitfalls with concrete fixes: follow the docs and FAQ; install the ESLint hooks plugin (rules of Hooks + exhaustive-deps) to avoid stale effects illustrated by a dog-fetch example using AbortController; shift thinking from lifecycle methods to state-to-effect synchronization and use custom hooks for reusable logic; avoid overusing useCallback/useMemo without profiling; stop testing implementation details and prefer user-focused tests with React Testing Library instead of asserting hook internals.

AI-written summary · about

  1. 0:00Introduction
  2. 1:00Air Squat
  3. 2:30Stickers
  4. 4:10Starting without a good foundation
  5. 6:00Not using the ESM plugin
  6. 7:30Cant conditionally call a hook
  7. 8:00Dependency array
  8. 8:50Dogs
  9. 9:30Dog Info
  10. 12:25Thinking and Life Cycles
  11. 16:30Synchronization
  12. 19:25Overthinking Performance
  13. 20:25Using React UseCallback
  14. 21:35Takeaway
  15. 22:10Testing Implementation Details
  16. 24:37Upgrade to Hooks
  17. 25:50Resources
~/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.