~/talk

Custom Hooks in React: The Ultimate UI Abstraction Layer

Talkat JSConf Hawaiʻi 2020 · 2020-02-05..02-07· [react, frontend-architecture]
slides:none on file

Custom hooks do the heavy lifting: a concrete useDarkMode reads matchMedia and syncs theme, a useClickOutside uses refs and a callback-ref pattern to avoid repeated listeners, stores move from useState to useReducer with multi-context splitting to reduce rerenders, persistence uses localStorage, network uses axios or React Query or Apollo for caching and mutations, and libraries like react-table expose only hooks — these patterns are implemented and shown working.

AI-written summary · about

  1. 0:00Start
  2. 2:02Class Lifecycles
  3. 2:13Synchronization
  4. 2:35Custom Hooks
  5. 3:18Affordances
  6. 5:33Dark Mode
  7. 13:15Creating a Global Store
~/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.