What problem does it solve?
Zustand enables predictable, scalable React state management by organizing store slices and shared actions, reducing prop-drilling and boilerplate.
Core Features & Use Cases
- Slice-based stores: Build modular state with small, focused slices (e.g., topics, messages) and combine them.
- Action-driven updates: Define clear public actions and internal handlers to orchestrate state changes.
- Selectors & memoization: Access derived data efficiently via selectors and avoid unnecessary recomputations.
- Use Case: In a complex React app, split the store into slices for authentication, UI state, and domain data, and coordinate updates through actions.
Quick Start
Install Zustand in your project with npm i zustand, then create a store file and import it in your components to begin reading and updating state.