React

Guide React development with best practices for hooks, state, and forms.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/zangxin75/openclaw-skills --skill react-zangxin75
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: React
Source: https://github.com/zangxin75/openclaw-skills/tree/main/react
Command: npx skills add https://github.com/zangxin75/openclaw-skills --skill react-zangxin75

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers build efficient, user-friendly React applications by providing best practices and avoiding common pitfalls in component development, state management, and performance optimization.

Core Features & Use Cases

  • Component Best Practices: Avoid common mistakes like rendering "0" for falsy conditions or mutating state directly.
  • Hook Usage: Understand correct useEffect patterns, dependency management, and cleanup.
  • Performance Optimization: Learn to use useMemo, startTransition, and Promise.all to improve application speed.
  • State Management: Colocate state effectively and leverage useReducer for complex updates.
  • Forms (React 19+): Utilize form actions and useActionState for robust form handling.
  • Use Case: A developer is struggling with slow re-renders in their React application. They can use this Skill to identify and fix issues related to state management, expensive computations, and inefficient data fetching.

Quick Start

Use the React skill to refactor the useEffect hook in the UserProfile component to include proper cleanup for event listeners.

Frequently Asked Questions about React

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

FAQPage Schema
How do I fix direct state mutation issues in React components?

To fix direct state mutation in React, you should avoid modifying state objects directly and instead create new state references. This Skill provides guidance on identifying and correcting common state mutation mistakes to ensure proper component rendering.

What is the best way to handle async operations inside useEffect?

Handling async operations inside useEffect requires proper patterns to avoid race conditions and memory leaks. This Skill explains async patterns, dependency array management, and cleanup functions to manage data fetching and event listeners effectively.

How do I optimize slow re-renders and expensive computations in React?

Optimizing slow re-renders in React involves using hooks like useMemo and startTransition to prevent unnecessary recalculations. This Skill helps identify performance bottlenecks related to state management and sequential data fetching.

Can I use useReducer for complex state architecture in React?

Yes, you can use useReducer for complex state updates to colocate state effectively. This Skill provides best practices for state architecture, helping you transition from useState to useReducer for manageability.

Does this guidance cover form actions and optimistic updates in React 19?

Yes, this Skill supports modern React 19 features including form actions, useActionState, and optimistic updates. It provides best practices for robust form handling and managing UI state before server confirmation.

Why does my React component render 0 for falsy conditions?

Rendering 0 for falsy conditions in React happens when using logical AND operators with numeric falsy values. This Skill helps you avoid common component mistakes by providing correct conditional rendering patterns.