web-state-zustand
Installation
SKILL.md
Client State Management Patterns
Quick Guide: Local UI state? useState. Shared UI (2+ components)? Zustand. Server data? Use your data fetching solution. URL-appropriate filters? searchParams. NEVER use Context for state management. Zustand v5: use
useShallowfromzustand/react/shallow(not the old equality-fn second arg), selectors must return stable references, andpersistno longer stores initial state during creation.
Detailed Resources:
- examples/core.md - Store setup, selectors, useShallow, Context anti-patterns, URL state
<critical_requirements>
CRITICAL: Before Managing Client State
(You MUST use a data fetching solution for ALL server/API data - NEVER useState, Zustand, or Context)
(You MUST use Zustand for ALL shared UI state (2+ components) - NOT Context or prop drilling)
(You MUST use useState ONLY for truly component-local state - NOT for anything shared)