react-state-management

Provides guidance for structuring React state and minimizing rerenders in component hierarchies.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/aidanaden/sg-food-guide --skill react-state-management-aidanaden
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-state-management
Source: https://github.com/aidanaden/sg-food-guide/tree/main/.agents/skills/react-state-management
Command: npx skills add https://github.com/aidanaden/sg-food-guide --skill react-state-management-aidanaden

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

State management and data flow best practices for React. This skill should be used when designing component architecture, deciding where state should live, or structuring state to avoid re-renders and bugs. Triggers on tasks involving useState, state lifting, component hierarchy design, or re-render optimization.

Core Features & Use Cases

  • Decide where state should live in the component tree to minimize re-renders and improve maintainability.
  • Enforce safer state patterns (avoid derived or contradictory state, hoist stable values outside components, and use discriminated unions for async states).
  • Provide guidelines for designing scalable component hierarchies and data flow in React applications.

Quick Start

Ask for a React component design plan that optimizes state placement, lifting decisions, and data flow to minimize re-renders.

Frequently Asked Questions about react-state-management

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

FAQPage Schema
Where should React state live to minimize unnecessary re-renders?

To minimize re-renders in React, place state at the lowest leaf component that owns it and lift only when sibling components need shared access. This localizes re-render scope and improves overall component maintainability.

How do I structure React state to avoid derived or contradictory data?

Avoid derived or contradictory React state by storing only minimal essential state and computing derived values on the fly during render. This prevents bugs where multiple state variables fall out of sync during updates.

What is the best way to handle async fetch state in React components?

Use discriminated unions to model React async fetch state, enforcing mutually exclusive loading, success, and error variations. This eliminates invalid state combinations and guarantees safe data flow transitions.

When should I lift state up in a React component hierarchy?

Lift React state up only when multiple sibling components need to read or update the same shared data. If state is used by a single component, keep it localized there to avoid triggering unnecessary re-renders higher in the tree.

How do I design scalable React component hierarchies and data flow?

Design scalable React component hierarchies by applying leaf-state placement, keeping minimal essential state, and hoisting stable values outside components. This architecture guides predictable data flow and limits re-render blast radius.

Why does lifting React state cause performance issues and extra re-renders?

Lifting React state causes extra re-renders because higher-level components holding the state re-render on every update, forcing all child components in the subtree to re-render even if they don't depend on the changed data.