Learn Zustand (modern state management for React) from the ground up to production-grade: pre-requisites & environment setup, history & background, core concepts & key architecture, installation setup & your first store, the create() set & get API, selectors & subscriptions, actions & async state, TypeScript & typing stores, the persist middleware, the immer middleware, the devtools & redux middleware, advanced persistence & rehydration, server state & data integration, performance & transient updates, SSR React 19 & framework integration, security & state best practices, custom middleware & the slice pattern, Zustand outside React (vanilla store), testing stores & middleware, optimization & debugging, the latest stable features in v5.x, production-ready architecture, all the way to the alternative ecosystem & final reflection with a total of 23 episodes.
Before touching Zustand, you need to master modern JavaScript, React hooks, and understand the difference between local state, global state, and server state. This episode sets up a Vite project, installs zustand, and verifies your first installation.

This episode reviews the evolution of React state management from prop drilling, the Context API, to boilerplate-heavy Redux, then the birth of Zustand by the pmndrs team in 2019. You will also understand the problems Zustand solves: no Provider, selective re-renders, and a size of around 1.2 KB gzipped.

This episode breaks down the Zustand store model that holds state and actions in a single object, the subscribe/notify mechanism behind the scenes, the three core APIs useStore, setState, and subscribe, as well as the concepts of selectors, transient updates, and the vanilla store.

This episode practices project preparation: creating a React project, installing zustand, organizing the stores folder structure, and writing your first counter store. You also learn the pattern of reading state via selectors and the limitations of destructuring the entire store.

This episode breaks down the anatomy of create((set, get) => ...), the two forms of set — a plain object and an updater function — and the role of get for reading the current state inside actions. You also learn correct update patterns with spread and immutability.

This episode covers selectors as the key to minimal re-renders, using useShallow from zustand/react/shallow to select several slices at once, and manual subscriptions with subscribeWithSelector for logging, analytics, and synchronization outside React.

This episode covers placing logic inside the store as actions, async actions with async/await, managing loading/error/success status, and centralized error handling for clean, testable data fetching.

This episode covers writing typed stores with create<State>()(...), defining state and action interfaces, typing middleware, using StoreApi, and the combine pattern for slicing large stores without losing types.

This episode covers the persist middleware that saves state to localStorage or sessionStorage automatically, the name option for the storage key, partialize for choosing the subset of state to store, and skipHydration for controlling the rehydration process.

This episode covers the immer middleware for updating nested state in a mutable-but-immutable way through draft functions, comparing it with manual spread, when to use immer versus spread, and the performance trade-offs of both.
