zustand-docs
Installation
SKILL.md
Zustand — React State Management
Overview
Zustand is a small, fast, and scalable state management library for React. It uses a hook-based API with no boilerplate, no providers, and no context. State lives in a store created via create(), and components subscribe to slices of that store using selector functions.
Key Features
- No providers needed — stores are standalone hooks, no
<Provider>wrapper required - Hook-based API —
create()returns a hook you call with selectors - Shallow merge by default —
set()shallow-merges state updates - Middleware support —
persist,devtools,immer,redux,combine,subscribeWithSelector - Vanilla stores —
createStore()for framework-agnostic state management - TypeScript-first — curried
create<T>()(...)pattern for full type inference - Performance — selector-based subscriptions minimize re-renders;
useShallowfor shallow comparison - Next.js / SSR compatible — per-request store creation with context providers