State Management at Scale
Sort state into its kinds, see where context stops scaling, and learn Zustand, Redux Toolkit, atoms, signals and state machines, and how to choose between them.
Small apps keep state in useState, lift it up, and pass it down, with context for the few values everybody needs. As an app grows, three problems appear: one context change re-renders half the screen, data from the server gets copied into state and goes stale, and nobody can say where a value lives. This phase fixes all three.
You'll first sort state into its kinds (UI, form, server, URL and global client state) and give each kind its proper home. Then you'll measure why a big context re-renders too much and build the fix yourself: an external store read with useSyncExternalStore and a selector. Every library in this phase is that same idea, polished: Zustand, Redux Toolkit, atoms (Jotai), signals, MobX and state machines (XState).
Every live example logs its renders, so you can count re-renders with your own eyes instead of trusting a benchmark. The last topic is a decision guide: which tool for which job, how TanStack Query and a small client store share the work, and how to migrate a real app one piece at a time.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.