~/talk

Getting Closure on Hooks

Talkat JSConf.Asia 2019 · 2019-06-14..06-16· [react]
slides:none on file

Builds a working React Hooks clone in 29 lines of readable JavaScript, using plain closures, a module-wrapped hook store, and an index-based hook array to support multiple hooks and useState and useEffect semantics. Implements a tiny JSX createElement, a simple work loop to re-render to the DOM, and a custom data-fetching hook for images, all running in CodeSandbox. The claim is practical and demonstrated: it actually works end-to-end.

AI-written summary · about

  1. 0:00Introduction
  2. 0:55Rene Magritte
  3. 2:28What are closures
  4. 3:47Stateful functions
  5. 6:20State hook
  6. 8:39React module
  7. 9:05Component
  8. 15:35Hook rules
  9. 16:22Effects hook
  10. 16:47Implementation
  11. 19:02Use Effect
  12. 19:57Live Coding
  13. 21:35Testing
  14. 22:23Work Loop
~/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.