Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By secondskyv3.12.0MITIn 1 marketplace
Sets up Zustand global state in React with TypeScript, from store creation to persist middleware, slices and Next.js SSR hydration fixes. Covers migrating existing state from Redux or the Context API.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Status: Production Ready ✅ Last Updated: 2025-10-24 Production Tested: Used across 2025 React ecosystem, React 19 compatible
Claude Code automatically discovers this skill when you mention:
Provides production-tested patterns for Zustand state management in React with TypeScript. Covers basic setup, middleware configuration (persist, devtools), slices pattern for modular stores, Next.js SSR handling, and advanced TypeScript patterns.
✅ TypeScript Setup - Correct create<T>()() syntax with full type inference
✅ Persist Middleware - localStorage/sessionStorage with hydration handling
✅ Slices Pattern - Modular store organization for large apps
✅ Next.js Integration - SSR-safe stores with hydration checks
✅ Devtools - Redux DevTools integration for debugging
✅ Common Patterns - Async actions, computed values, selectors, resets
✅ Error Prevention - Prevents 5 documented issues with production-tested solutions
✅ 8 Templates - Ready-to-use store patterns for every use case
| Issue | Why It Happens | Source | How Skill Fixes It |
|---|---|---|---|
| Next.js Hydration Mismatch | Persist middleware reads localStorage on client but not server | DEV.to | _hasHydrated flag pattern |
| TypeScript Double Parentheses | Missing currying syntax breaks middleware types | Official TypeScript Guide | Always use create<T>()() |
| Persist Import Error | Wrong import path or version mismatch | GitHub #2839 | Correct imports for v5 documented |
| Infinite Render Loop | Creating new objects in selectors | GitHub #2642 | Use shallow or select primitives |
| Slices TypeScript Complexity | Complex StateCreator types fail | Official Slices Guide | Explicit type annotations provided |
# Install Zustand (Bun preferred)
bun add zustand # preferred
# or: npm install zustand
# Create store
cat > src/store.ts << 'EOF'
import { create } from 'zustand'
interface BearStore {
bears: number
increase: () => void
}
export const useBearStore = create<BearStore>()((set) => ({
bears: 0,
increase: () => set((state) => ({ bears: state.bears + 1 })),
}))
EOF
# Use in component
cat > src/App.tsx << 'EOF'
import { useBearStore } from './store'
function App() {
const bears = useBearStore((state) => state.bears)
const increase = useBearStore((state) => state.increase)
return (
<div>
<h1>{bears} bears</h1>
<button onClick={increase}>Add bear</button>
</div>
)
}
EOF
Result: Type-safe, minimal global state with zero boilerplate
Full instructions: See SKILL.md
| Package | Version | Status |
|---|---|---|
| zustand | 5.0.14 | ✅ Latest stable |
| react | 19.0.0 | ✅ Compatible |
| typescript | 5.0+ | ✅ Supported |
Prerequisites: None (standalone skill)
Integrates With:
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub secondsky/claude-skills --plugin zustand-state-managementPlugins from other owners that cover similar ground