~/talk

Refactoring off the hook(s)

Talkat React Alicante 2019 · 2019-09-26..09-28· [react, testing]

Refactors a small color-picker app and shows concrete before-and-after code: replaces one big state object with multiple useState calls, moves complex logic into useReducer, and synchronizes URL and cursor with useEffect. Extracts shared logic into a custom hook and a provider so subscriptions are registered once. Demonstrates unit testing of hooks, reports the UI becomes simpler and less boilerplate, and shows the refactored app working live with the URL and history sync intact.

AI-written summary · about

  1. 0:00Start
  2. 34:32WHY HOOKS
  3. 37:10ARE CLASSES DISAPPEARING?
  4. 37:45WHAT'S THE MOST IMPORTANT TAKE AWAY?
~/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.