react
Use when building or reviewing React component architecture, hooks usage, and performance patterns. Do not use when the work is framework-agnostic styling, routing, or state management owned by another skill.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- react
- license
- MIT
- metadata
- { "owner": "Harley Bartles", "scope": "React component architecture, hooks usage, and performance patterns.", "status": "active", "use_when": [ "building or reviewing React component architecture.", "choosing, ordering, or refactoring hooks.", "lifting state, composing components, or handling conditional rendering.", "optimizing renders with memo, useMemo, useCallback, or React.memo.", "deciding whether server components or a framework-specific skill is more appropriate." ], "source-id": "react", "source-path": "skills/react/SKILL.md", "related_skills": [ "typescript", "web-styling" ], "do_not_use_when": [ "the work is framework-agnostic styling; use the web-styling skill.", "the work is TypeScript-specific type design; use the typescript skill.", "the work is routing or global state management owned by another skill.", "the task requires Next.js or framework-specific server components; use the appropriate framework skill." ], "provenance-name": "React first-party skill", "source-category": "first_party" }
- description
- Use when building or reviewing React component architecture, hooks usage, and performance patterns. Do not use when the work is framework-agnostic styling, routing, or state management owned by another skill.
02 资源文件 5
- 参考文档agents/openai.yaml396 B
- 资产文件assets/authority/authority.yaml1.0 KB
- 资产文件assets/authority/CITATIONS.md880 B
- 资产文件assets/authority/source-map.yaml467 B
- 参考文档references/operational-guidance.md2.9 KB
03 SKILL.md 正文
React
Overview
React lets you build UIs from declarative components. This skill covers component architecture, hooks, and performance patterns grounded in the React documentation.
When to Use
- Designing or reviewing functional components and JSX.
- Choosing, ordering, or refactoring hooks (
useState,useEffect,useContext, custom hooks). - Lifting state, composing children, or handling conditional rendering.
- Optimizing renders with
memo,useMemo,useCallback, orReact.memo. - Deciding when server components or a framework-specific skill such as Next.js is more appropriate.
Do not use for framework-agnostic styling; defer to web-styling. Do not use for TypeScript-only type design; defer to typescript. Do not use for routing, global state management, or framework-specific server frameworks.
Core Pattern
- Favor small, single-responsibility functional components.
- Keep hooks at the top level and outside loops, conditions, and nested functions.
- Lift state to the closest common ancestor and pass data down through props.
- Use
useEffectto synchronize with external systems, not to derive state. - Memoize only after measuring; avoid premature optimization.
Common Mistakes
- Calling hooks conditionally or inside loops.
- Using
useEffectto transform state that can be derived during render. - Passing new object or array literals to optimized children without memoization.
- Mixing presentational concerns with side effects.
- Choosing server components or Next.js when only client-side composition is needed.
04 同仓库更多 Skills
writing
Use when drafting, revising, or reviewing prose for human readers and clarity, an authorised voice, or reader-fatigue concerns may interact.
writing-with-clarity
Use when drafting, revising, or reviewing prose intended for human readers, including documentation, README files, reports, explanations, UI copy, errors, comments, commit messages, and pull request text.
writing-style
Use when revising or reviewing human-facing prose against an authorised voice card or a contextual reader-fatigue profile.
skill
暂无简介
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment.
writing-roadmaps
Use when a goal is too large for one writing-plans plan and requires a sequenced roadmap of consecutive plans.