~/talk

Let’s break React’s rules

Talkat React Conf 2024 · 2024-05-15..05-16· [react]
slides:none on file

Demonstrates why calling hooks out of order breaks React by building a recipe app in React and React Native, using useState, the fiber tree, and a React Native FlatList renderItem example. Shows a conditional useState inside a render function that stores hooks as a linked list in the fiber, then adding a third ingredient causes the missing-hook crash (three calls is the surprising failure point). Rewrites the app to put state inside an Ingredient component and the bug disappears, proving the rule matters.

AI-written summary · about

  1. 0:00Introduction
  2. 0:25Breaking first hook rule
  3. 3:33Fiber tree and rendering
  4. 5:17Why conditional hooks break apps
  5. 6:43Rules of React explained
  6. 7:46Breaking second hook rule
  7. 11:45Correct hook usage in components
  8. 13:08Why rules prevent crashes
  9. 14:12Understanding React's rules
~/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.