~/talk

React refactoring, off the hook(s)!

Talkat JSDay 2019 · 2019-05-08..05-09· [react, testing]

Refactors a busy class component into functions and shows concrete results: state split into multiple useState hooks, performance bumps from useState, useCallback, useEffect, useReducer, a custom URL sync hook that stores filter and sort in the query string, and Jest tests that mock history to assert subscribe/unsubscribe and object-to-history calls. The color-list app is rebuilt, the URL restores state on load, and the live demo and GitHub branch named "a factory talk" work as shown.

AI-written summary · about

  1. 0:00Start
  2. 19:20Use Callback
  3. 19:47User Reducer
  4. 20:19Reducer Function
  5. 39:26Why Should We Use Hooks
~/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.