We don’t know how React state hooks work
summary
Explains that setState/useReducer calls go into an update queue and are applied lazily during render, that React sometimes does an eager computation to decide whether to bail out, and that updates inside event handlers are batched while asynchronous callbacks are not unless you use unstable_batchedUpdates. Recommends using effects to run code after state changes, warns about recycled synthetic events (fixed in React 17), and notes reducers and useState share the same underlying mechanism.
AI-written summary · about
chapters (7)
- 0:00Start
- 4:08What I used to think
- 6:28What React does (simplified)
- 11:36Remember this slide?
- 12:53Cache the eager result
- 17:55What about this?
- 22:36To summarise








