~/talk

Clean React Global State Management Without Dependencies

Talkat DevDays Europe 2024 · 2024-05-20..05-24· [react, frontend-architecture]
slides:none on file

Claims a dependency-free global store built with createStore and hooked into React 18 via useSyncExternalStore, implemented in TypeScript with memoized callbacks. Builds a small app (header, body, shares, footer), shows per-component selectors that update only the changed item and skip renders when values are identical. Shows an SSR init path to hydrate server props, supports multiple independent stores, and demonstrates that the implementation actually reduces unnecessary re-renders in the demo.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03State management without dependencies
  3. 2:10Talk outline
  4. 4:19React TypeScript project
  5. 7:09Requirements for global state
  6. 8:56Defining the store
  7. 10:21Listeners for state updates
  8. 11:25useSyncExternalStore hook
  9. 12:52Subscribing components
  10. 13:14Selectors in components
  11. 14:21Updating with setState
  12. 15:25Avoiding re-renders
  13. 16:28Updating shares component
  14. 17:10Live demo
  15. 18:14Testing updates
  16. 19:39Adding new shares
  17. 21:07useCallback for renders
  18. 21:28Next.js SSR handling
  19. 22:30Reusing the store
  20. 22:51Conclusion
  21. 24:38Q&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.