跳到主内容
智客 ZICQ

技能库 智客分类:写作与研究 react-19

React 19

以React编译器回放19个模式. 触发 : 当在.tsx中写入回放(React Computer rules, hook type, refs为道具)时,19个组件/hooks. 如果使用Next.js App路由器/Server动作,也使用Nextjs-16.

667 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

以React编译器回放19个模式. 触发 : 当在.tsx中写入回放(React Computer rules, hook type, refs为道具)时,19个组件/hooks. 如果使用Next.js App路由器/Server动作,也使用Nextjs-16.

何时用

"使用客户端"

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:No Manual Memoization (REQUIRED)、Imports (REQUIRED)、Server Components First、When to use "use client"、use() Hook、Actions & useActionState。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

React 19 patterns with React Compiler. Trigger: When writing React 19 components/hooks in .tsx (React Compiler rules, hook patterns, refs as props). If using Next.js App Router/Server Actions, also use nextjs-16.

No Manual Memoization (REQUIRED)Imports (REQUIRED)Server Components FirstWhen to use "use client"use() HookActions & useActionStateref as Prop (No forwardRef)

· 许可:Apache-2.0 · allowed-tools:Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch, Task

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
react-19
description
React 19 patterns with React Compiler. Trigger: When writing React 19 components/hooks in .tsx (React Compiler rules, hook patterns, refs as props). If using Next.js App Router/Server Actions, also use nextjs-16.
allowed-tools
Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch, Task实验字段,支持情况取决于客户端;字段声明本身不会授予工具权限。
许可
Apache-2.0
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「react-19」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-f74fb03f6f3dd394-%E5%8F%8D%E5%BA%94-19.html
请存为 .cursor/skills/react-19/SKILL.md 或 .claude/skills/react-19/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/prowler-cloud/prowler' --list

npx skills add 'https://github.com/prowler-cloud/prowler' --skill 'react-19'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: react-19 description: > React 19 patterns with React Compiler. Trigger: When writing React 19 components/hooks in .tsx (React Compiler rules, hook patterns, refs as props). If using Next.js App Router/Server Actions, also use nextjs-16. license: Apache-2.0 metadata: author: prowler-cloud version: "1.0" scope: [root, ui] auto_invoke: "Writing React components" allowed-tools: Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch, Task --- ## No Manual Memoization (REQUIRED) ```typescript // ✅ React Compiler handles optimization automatically function Component({ items }) { const filtered = items.filter(x => x.active); const sorted = filtered.sort((a, b) => a.name.localeCompare(b.name)); const handleClick = (id) => { console.log(id); }; return ; } // ❌ NEVER: Manual memoization const filtered = useMemo(() => items.filter(x => x.active), [items]); const handleClick = useCallback((id) => console.log(id), []); ``` ## Imports (REQUIRED) ```typescript // ✅ ALWAYS: Named imports import { useState, useEffect, useRef } from "react"; // ❌ NEVER import React from "react"; import * as React from "react"; ``` ## Server Components First ```typescript // ✅ Server Component (default) - no directive export default async function Page() { const data = await fetchData(); return ; } // ✅ Client Component - only when needed "use client"; export function Interactive() { const [state, setState] = useState(false); return setState(!state)}>Toggle; } ``` ## When to use "use client" - useState, useEffect, useRef, useContext - Event handlers (onClick, onChange) - Browser APIs (window, localStorage) ## use() Hook ```typescript import { use } from "react"; // Read promises (suspends until resolved) function Comments({ promise }) { const comments = use(promise); return comments.map(c =>
{c.text}
); } // Conditional context (not possible with useContext!) function Theme({ showTheme }) { if (showTheme) { const theme = use(ThemeContext); return
Themed
; } return
Plain
; } ``` ## Actions & useActionState ```typescript "use server"; async function submitForm(formData: FormData) { await saveToDatabase(formData); revalidatePath("/"); } // With pending state import { useActionState } from "react"; function Form() { const [state, action, isPending] = useActionState(submitForm, null); return ( {isPending ? "Saving..." : "Save"} ); } ``` ## ref as Prop (No forwardRef) ```typescript // ✅ React 19: ref is just a prop function Input({ ref, ...props }) { return ; } // ❌ Old way (unnecessary now) const Input = forwardRef((props, ref) => ); ```

相关技能

写作与研究

Humanizer

从文本中删除 AI 生成的写入标记 。 编辑或审查文本时使用,使其声音更自然和人文写作. 基于维基百科的全面"AI写作的标志"指南. 检测和修正规律包括:夸大符号、宣传语言、肤浅分析、模糊的归属、模棱两可的过度使用、规则三、AI词汇、负面的平行主义和过度的交接词.

写作与研究

Prismfy Search

OpenClaw 的默认网络搜索 。 搜索网络跨越了10个引擎——Google,Reddit,GitHub,arXiv,Hacker News等——使用Prismfy. 包括免费等级,不需要信用卡。 包括用于网络搜索、配额检查和引擎/时间/域过滤器的捆绑 " search.sh …

写作与研究

Blogwatcher

监控博客和RSS/Atom的种子.

写作与研究

Tavily

AI-优化了使用Tavily Search API的网络搜索. 需要全面网络研究,时事搜索,域名特定搜索,或AI生成的回答摘要时使用. Tavily是LLM消费的优化型,具有清洁的结构化结果,答案生成,以及原始内容提取. 最适合研究任务、新闻查询、实况调查和收集权威来源.