~/talk

We don’t know how React state hooks work

Talkat reactjsday 2020 · on Thursday, 2020-10-15· [react]
slides:none on file

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

  1. 0:00Start
  2. 4:08What I used to think
  3. 6:28What React does (simplified)
  4. 11:36Remember this slide?
  5. 12:53Cache the eager result
  6. 17:55What about this?
  7. 22:36To summarise
~/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.