sickn33/antigravity-awesome-skills/react-state-management
Claude Code and agent skill by sickn33/antigravity-awesome-skills
- community
Checking that the SKILL.md file is still in the repository.
Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query. Use when setting up global state, managing server state, or choosing between state management solutions.
Install
npx vskill@latest install sickn33/antigravity-awesome-skills/react-state-managementSKILL.md
React State Management
Comprehensive guide to modern React state management patterns, from local component state to global stores and server state synchronization.
Do not use this skill when
- The task is unrelated to react state management
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
Use this skill when
- Setting up global state management in a React app
- Choosing between Redux Toolkit, Zustand, or Jotai
- Managing server state with React Query or SWR
- Implementing optimistic updates
- Debugging state-related issues
- Migrating from legacy Redux to modern patterns
Core Concepts
1. State Categories
| Type | Description | Solutions | |
|---|---|---|---|
| Local State | Component-specific, UI state | useState, useReducer | |
| Global State | Shared across components | Redux Toolkit, Zustand, Jotai | |
| Server State | Remote data, caching | React Query, SWR, RTK Query | |
| URL State | Route parameters, search | React Router, nuqs | |
| Form State | Input values, validation | React Hook Form, Formik |
2. Selection Criteria
Quick Start
Zustand (Simplest)
Patterns
Pattern 1: Redux Toolkit with TypeScript
Pattern 2: Zustand with Slices (Scalable)
Pattern 3: Jotai for Atomic State
Place Suspense outside the component that calls the async atom hook (for example, wrap <Profile /> in <Suspense> at its parent); a boundary returned after a suspending hook cannot catch that suspension.
Pattern 4: React Query for Server State
Pattern 5: Combining Client + Server State
These are partial client-side fragments. Do not persist credentials/private user records in localStorage or expose them through devtools. Create request-isolated stores/caches for SSR and clear tenant/user data on sign-out. Include authorization context in server query keys; frontend isAuthenticated flags do not authorize APIs. Validate fetched JSON at runtime. Optimistic snapshots can overwrite concurrent mutations: serialize conflicting writes or reconcile from the server; invalidate affected lists as well as detail queries.
Best Practices
Do's
- Colocate state - Keep state as close to where it's used as possible
- Use selectors - Prevent unnecessary re-renders with selective subscriptions
- Normalize data - Flatten nested structures for easier updates
- Type everything - Full TypeScript coverage prevents runtime errors
- Separate concerns - Server state (React Query) vs client state (Zustand)
Don'ts
- Don't over-globalize - Not everything needs to be in global state
- Don't duplicate server state - Let React Query manage it
- Don't mutate directly - Always use immutable updates
- Don't store derived data - Compute it instead
- Don't mix paradigms - Pick one primary solution per category
Migration Guides
From Legacy Redux to RTK
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/react-state-management/SKILL.md
Popularity
- Repository stars
- 35,925
- Repository forks
- 5,890
- Repository npm downloads, 7 days
- 7,289
- 7-day trend score
- 74
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 1 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sickn33/antigravity-awesome-skills/react-state-management)