用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/G1Joshi/Agent-Skills --skill react命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | react |
| description | React component-based UI with hooks, context, and state management. Use for .jsx/.tsx files. |
React is the standard library for building user interfaces. React 19 (2025) introduces a new era with the React Compiler, Server Components, and Actions.
import { use, Suspense } from "react";
// New: 'use' hook for promises
function Comments({ commentsPromise }) {
const comments = use(commentsPromise);
return comments.map((c) => <p key={c.id}>{c.text}</p>);
}
export default function Page({ id }) {
const commentsPromise = fetchComments(id);
return (
<Suspense fallback={<p>Loading...</p>}>
<Comments commentsPromise={commentsPromise} />
</Suspense>
);
}
React 19 introduces an auto-memoizing compiler. You no longer need useMemo or useCallback manually in 99% of cases. The compiler treats code as "memoized by default".
Components that run only on the server. They don't send JS to the client.
'use server': Marks a function as a Server Action (callable from client).'use client': Marks a component as interactive (hydrated on client).useActionStateNative support for async form submission.
function Form() {
const [error, submitAction, isPending] = useActionState(
async (prev, formData) => {
const error = await updateProfile(formData);
if (error) return error;
return null;
},
null,
);
return (
<form action={submitAction}>
<input name="name" />
<button disabled={isPending}>Save</button>
{error && <p>{error}</p>}
</form>
);
}
Do:
useMemo/useCallback unless you are building a library or strictly optimizing.fetch('/api/...') with robust Server Actions for data mutations.ref as a prop: In React 19, ref is a plain prop. No more forwardRef.Don't:
useEffect: Effects are for synchronization with external systems, not for data fetching or derived state.