We Don’t Know How React State Hooks Work
summary
Code-level behavior: each hook keeps a per-hook update queue and setState pushes actions that React consumes only during render (lazy) unless React eagerly computes and caches the next state to bail out. useState delegates to useReducer under the hood. Event handlers run inside batches so multiple setState calls collapse to one render; async handlers run outside a batch and produce separate renders, so two same updates can produce one render versus two renders depending on context.
AI-written summary · about
chapters (5)
related talks
43mWe don’t know how React state hooks work
24mReact on the Hooks
45mWhy I am hooked on the future of React
27mHooked on React Hooks
31mWhy we’ll all use React Hooks
27mEric Bishard - State Management with React Hooks
29mState Management with React Hooks
36mReusing Stateful Logic in React: HOC vs Render Props vs Hooks
