frontend-react
Skill3 starsChanged 9 months agoMITView on GitHub
专业的 React 开发技能,涵盖 Next.js、React Server Components、Tailwind CSS 和 React 生态系统。使用此技能构建现代 React 应用程序、实现 Next.js 功能、使用 shadcn/ui 创建 UI 组件,或处理复杂状态管理。
3 other projects use a version of this.
Adopted by
Most recently taken up by
- carlosedm10/skillstheir own version, first seen Aug 8, 2026
- Devdannnny/chiseltheir own version, first seen May 22, 2026
- mujez/claude-skillstheir own version, first seen Feb 10, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- mujez/claude-skills★ 47same name
- Devdannnny/chisel★ 3same name
- carlosedm10/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- api-designSkill
- database-designSkill
- design-patternSkill
- enterprise-javaSkill
- frontend-reactSkill
- frontend-svelteSkill
- frontend-vueSkill
- git-guruSkill
- go-developmentSkill
- javascript-typescriptSkill
- product-managementSkill
- python-developmentSkill
- session-summarySkill
- swift-developmentSkill
- swiftui-developmentSkill
- system-architectureSkill
- tech-documentationSkill
- testingSkill
- xcode-managementSkill
- api-designSkill
- database-designSkill
- design-patternSkill
- enterprise-javaSkill
- frontend-svelteSkill
- frontend-vueSkill
- git-guruSkill
- go-developmentSkill
- javascript-typescriptSkill
- product-managementSkill
- python-developmentSkill
- session-summarySkill
- swift-developmentSkill
- swiftui-developmentSkill
- system-architectureSkill
- tech-documentationSkill
- testingSkill
- xcode-managementSkill
The file
Files
React 开发技能
现代 React 开发的综合技能,专注于 Next.js、TypeScript、Tailwind CSS 和广泛的 React 生态系统。
技术栈
核心框架:React + Next.js
React 基础
- 基于组件:声明式 UI 构建块
- Hooks:函数式状态和副作用管理 (
useState,useEffect,useContext) - 虚拟 DOM:高效的协调和渲染
- React Server Components (RSC):静态内容的服务器端渲染,零客户端包大小
Next.js 特性 (App Router)
- App Router:
app/目录下基于文件系统的路由 - Server Actions:直接从客户端组件进行服务器端数据变更
- 流式 SSR:使用 Suspense 进行渐进式渲染
- Metadata API:SEO 和社交分享优化
- Route Handlers:
route.ts文件中的 API 端点 (GET, POST 等) - Middleware:请求拦截和处理
UI 框架:Tailwind CSS + shadcn/ui
Tailwind CSS
- 实用优先 CSS 框架
- 带有前缀的响应式设计 (
md:,lg:) - 通过
tailwind.config.ts进行自定义配置 - 深色模式支持
shadcn/ui
- 基于 Radix UI 和 Tailwind CSS 构建的可重用组件
- 可访问且可定制
- "拥有你的代码" 理念 (将组件代码复制到你的项目中)
- 关键组件:Button, Dialog, Form, Dropdown, Card, Sheet
状态管理
- 本地状态:
useState,useReducer - 全局状态:React Context, Zustand (用于轻量级全局状态)
- 服务器状态:TanStack Query (React Query) 用于异步数据获取和缓存
项目架构
推荐目录结构 (Next.js App Router)
src/
├── app/
│ ├── layout.tsx # 根布局
│ ├── page.tsx # 首页
│ ├── globals.css # 全局样式
│ ├── (auth)/ # 路由组 (不影响 URL 路径)
│ │ ├── login/
│ │ │ └── page.tsx
│ │ └── register/
│ │ └── page.tsx
│ └── api/ # API 路由
├── components/
│ ├── ui/ # shadcn/ui 组件
│ │ ├── button.tsx
│ │ └── ...
│ ├── Navbar.tsx
│ └── Footer.tsx
├── lib/
│ ├── utils.ts # 工具函数 (cn 等)
│ └── db.ts # 数据库连接
└── hooks/ # 自定义 React hooks
└── use-toast.ts最佳实践
组件设计
- 默认服务端:对不需要交互的所有内容使用 Server Components。
- 客户端边界:仅在使用 hooks 或事件监听器时添加
'use client'指令。 - 组合:使用
children属性以避免属性钻取 (prop drilling)。 - 微组件:将复杂的 UI 分解为更小的、单一职责的组件。
性能
- 图片优化:使用
next/image进行自动优化。 - 字体优化:使用
next/font以防止布局偏移。 - 懒加载:对重型组件使用
next/dynamic或React.lazy。 - 代码分割:Next.js 中自动进行,但要注意大型依赖项。
可访问性 (a11y)
- 使用语义化 HTML 标签 (
<main>,<article>,<nav>)。 - 确保所有交互元素都支持键盘操作。
- 当语义化 HTML 不够时使用有效的 ARIA 属性。
- Radix UI 原语 (用于 shadcn/ui) 自动处理许多无障碍问题。
常见代码模式
Next.js 页面 (Server Component)
import { db } from "@/lib/db"
export default async function DashboardPage() {
const data = await db.user.findMany()
return (
<main className="p-6">
<h1 className="text-2xl font-bold">仪表板</h1>
<ul>
{data.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
</main>
)
}带状态的客户端组件
"use client"
import { useState } from "react"
import { Button } from "@/components/ui/button"
export function Counter() {
const [count, setCount] = useState(0)
return (
<div className="flex gap-4 items-center">
<span>计数: {count}</span>
<Button onClick={() => setCount(c => c + 1)}>增加</Button>
</div>
)
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

