~/talk

Building Considerate React Component APIs with TypeScript

Talkat JSWorld Conference 2021 · 2021-02-22..02-27· [react, typescript]
slides:none on file

TypeScript gets used as a communication tool, not just a bug checker: prop names get clearer (rename input1 to headerText), loose types become specific (array of {label,value}), string literal unions enforce 'small'|'medium'|'large', Partial is swapped for Omit so size is prohibited, and the Select moves from string|number unions to a generic T so selected value always matches input. The result: the wireframe features land in code and the pages render as intended.

AI-written summary · about

  1. 0:00Considerate React component APIs
  2. 4:16Hoisting context into props
  3. 7:49TypeScript as communication tool
  4. 11:21Testing component APIs
  5. 13:49String literal unions for props
  6. 17:57Replacing partial with omit
  7. 21:28Generics for consistent types
  8. 24:38Advanced TypeScript types
  9. 26:00Why considerate APIs matter
  10. 27:45Closing & Q&A
~/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.