⚛️
FrontendJavaScript

React Best Practices

by huangjia2019

React Best Practices is a Frontend skill for Claude Code, published by huangjia2019 in claude-code-engineering.

1.1K stars379 forkson huangjia2019/claude-code-engineeringAdded 2026/08/21Repository updated 2026/07/23
agentagentic-aiaiclaudeclaude-codeclaude-skills
Install in seconds
Install React Best Practices
Copy React Best Practices into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/huangjia2019/claude-code-engineering/tree/main/10-Plugins/projects/03-team-toolkit/skills/react-patterns ~/.claude/skills/react-patterns

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/huangjia2019/claude-code-engineering.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
10-Plugins/projects/03-team-toolkit/skills/react-patterns/SKILL.md in huangjia2019/claude-code-engineering
Installs to
~/.claude/skills/react-patterns
Collection
One of 13 skills cataloged from this repository
Category
Frontend567 skills

What React Best Practices does

React Best Practices covers component design patterns, Hooks usage, and performance optimization for React code. Use it when implementing or reviewing React components and shared state patterns.

React Best Practices is cataloged under Frontend on DirSkills. React Best Practices comes from a repository tagged agent, agentic-ai, ai, claude and claude-code.

Documentation

README

React 最佳实践

本技能包含 React 开发的最佳实践,帮助你编写高质量的 React 代码。

目录

当用户需要特定主题时,加载对应章节:

只在用户明确需要时加载完整内容,避免浪费上下文窗口。

核心原则

  1. 组件单一职责:一个组件做一件事
  2. 状态提升最小化:状态放在需要它的最近公共祖先
  3. 避免过早优化:先让它工作,再让它快
  4. 优先组合而非继承:使用 children 和 render props

快速参考

自定义 Hook 命名

// 好的命名
useUser()
useLocalStorage()
useDebounce()

// 不好的命名
fetchUser()      // 不是 use 开头
useData()        // 太模糊

组件文件结构

ComponentName/
├── index.ts           # 导出
├── ComponentName.tsx  # 组件实现
├── ComponentName.test.tsx
├── ComponentName.styles.ts
└── types.ts           # 类型定义

Frequently asked about React Best Practices

  • What else does huangjia2019 publish alongside React Best Practices?

    React Best Practices is one of 13 skills that DirSkills catalogs from huangjia2019/claude-code-engineering, the repository it ships in. Its siblings there include API Conventions, API Documentation and API Documentation Generator. Each one is a separate skill with its own page in this directory, installs the same way React Best Practices does, and is maintained by huangjia2019 in that same repository. The rest of the collection is listed on the huangjia2019/claude-code-engineering page.

  • How does React Best Practices compare to other Frontend skills?

    React Best Practices ranks #313 by stars among the 567 Frontend skills in this catalog. The most-starred ones next to it are Angular Developer, Android Clean Architecture and Accessibility. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of React Best Practices against them. Open each page to compare what they document and how they install.

More from huangjia2019/claude-code-engineering

React Best Practices is one of 13 skills cataloged on DirSkills from huangjia2019/claude-code-engineering.

See all 13 skills