~/talk

Generic Components with TS and React

Talkat React Day Berlin 2022 · on Friday, 2022-12-02· [typescript, react]

A concrete example builds a selectable list component that accepts items of varying shapes by making props generic and constraining them to a minimal shape (uses T extends SelectItem so each item has an id). The demo wires it to vegetable and Game of Thrones datasets, adds icons, sees type errors in .tsx when using arrow generic components, and fixes them by either converting the arrow to a function or adding the extends constraint so the component works.

AI-written summary · about

~/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.