~/talk

Are we React-ing wrongly?

Talkat Voxxed Days Trieste 2024 · on Thursday, 2024-05-30· [react]
slides:none on file

Claim: useMemo and useCallback are overused and often harm more than help. Evidence: an official docs sample crashes (Azure Static Web App example left unpatched since 2022), benchmarks with 100 and 1,000 list items show memo saves under 1ms and sometimes slows the first render, and profiling reveals a first-render cost for memo allocation. Mechanism: useCallback produces cached function versions that invalidate on every click if they depend on state, causing many cached instances and potential memory overhead. Practical rules: avoid needless lifting, keep dependency lists small, and use memo/callback only for memoized children or hook dependencies.

AI-written summary · about

  1. 0:00React misconceptions
  2. 2:17React’s evolution and docs gaps
  3. 6:39Overusing useMemo and useCallback
  4. 10:14Performance myths of useMemo
  5. 15:00Benchmarking useMemo
  6. 22:09How useCallback works
  7. 25:22useCallback performance issues
  8. 30:25Correct useCallback cases
  9. 34:00Fix before optimize
  10. 37:16Avoiding new hooks traps
  11. 40:52Q&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.