home / skills / partme-ai / full-stack-skills / react
This skill provides comprehensive React guidance for building components, managing state and hooks, and optimizing performance in React applications.
npx playbooks add skill partme-ai/full-stack-skills --skill reactReview the files below or copy the command above to add this skill to your agents.
---
name: react
description: Provides comprehensive guidance for React development including components, JSX, props, state, hooks, context, performance optimization, and best practices. Use when the user asks about React, needs to create React components, implement hooks, manage component state, or build React applications.
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]
## How to use this skill
[待完善:根据具体工具添加使用指南]
## Best Practices
[待完善:根据具体工具添加最佳实践]
## Keywords
[待完善:根据具体工具添加关键词]
This skill provides comprehensive, practical guidance for React development, covering components, JSX, props, state, hooks, context, and performance optimization. It helps you design, implement, and debug React components and full React applications with modern best practices. Use it to accelerate development, reduce bugs, and improve maintainability.
The skill inspects your requirements or code snippets and offers targeted recommendations: component structure, prop typing, state management patterns, and hook usage. It explains trade-offs and gives example code patterns for functional components, custom hooks, context providers, memoization, and testing approaches. It also highlights performance bottlenecks and suggests optimizations like memo, virtualization, and code-splitting.
Should I use Context or Redux for global state?
Use Context for lightweight global concerns like theme or auth; choose Redux or other dedicated state libraries when you need structured global state, time-travel debugging, or predictable reducers for complex interactions.
When should I create a custom hook?
Create a custom hook to extract reusable logic between components, such as data fetching, form handling, or subscriptions. Keep hooks focused and side-effect aware.
How do I avoid unnecessary re-renders?
Avoid passing new object or function references as props each render; use memoization (React.memo, useCallback, useMemo) only where profiling shows benefit, and split large components into smaller ones.