Zustand State Management

Production-tested patterns for Zustand state management in React with TypeScript: creating type- safe stores, the slices pattern for modular stores, persist middleware backed by localStorage or sessionStorage, devtools and immer middleware, and selector plus shallow-equality patterns that avoid extra re-renders. Documents fixes for five recurring problems: Next.js SSR hydration mismatches and text content mismatch errors, the create<T>()() double-parentheses TypeScript syntax, persist middleware export errors, infinite render loops, and slices pattern type inference failures. Use when setting up global state in React, migrating from Redux or Context API, adding state persistence, wiring devtools, or debugging Zustand v5 typing and hydration issues.

jackspace Updated

File contents

jackspace/ClaudeSkillz/tree/main/skills/zustand-state-management commit 26419e01e0

Frequently asked questions

npx skillmds@latest add jackspace/zustand-state-management