React State Management

Provide standards for managing React state across local, global, server, and derived scopes.

Updated Jan 22, 2026
One-click install
npx skills add https://github.com/ngxtm/skill-rule --skill react-state-management-ngxtm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: React State Management
Source: https://github.com/ngxtm/skill-rule/tree/main/rules/react/state-management
Command: npx skills add https://github.com/ngxtm/skill-rule --skill react-state-management-ngxtm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of managing state in React applications, providing clear guidelines and best practices for different state scopes to prevent common pitfalls and improve performance.

Core Features & Use Cases

  • Scope-Based State Management: Recommends appropriate tools for local, derived, context, global, server cache, server state, and URL state.
  • Best Practices: Outlines essential implementation guidelines and common anti-patterns to avoid.
  • Use Case: Ensure your React application uses useState for simple local component state, Context API for theming or authentication, and a dedicated library like Zustand or Redux for complex global application state, leading to more maintainable and performant code.

Quick Start

Apply the React State Management skill to refactor the component's state logic to use Zustand for global state.

Frequently Asked Questions about React State Management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to manage React state for different scopes?

React state management tracks local, global, server, and derived scopes. Use useState for local component state, Context API for theming, and Zustand or Redux for complex global application state to ensure maintainable code.

How do I choose between Context API and Zustand for global state?

Choose Context API for low-frequency global state like authentication or theming. Select Zustand or Redux for complex global application state to maintain performance and avoid common re-render anti-patterns.

When do I need React Query or TanStack Query for server state?

You need React Query or TanStack Query for server state when managing remote data caching and fetching. This separates server data from client state, improving data consistency and application performance.

What are common React state management anti-patterns to avoid?

Common React state management anti-patterns include misusing Context API for high-frequency updates, causing unnecessary re-renders, and mixing local and global state boundaries, which degrades application performance and maintainability.

How do I refactor component state logic to use Zustand?

Refactor component state logic to Zustand by extracting local useState or useReducer variables into a dedicated global store. This separates global application state from component-level logic to improve maintainability.