github/awesome-copilot · react18-batching-patterns · SKILL.md
React 18批处理模式
提供精确模式,用于诊断和修复React 18类组件中的自动批处理回归问题。当类组件在异步方法、setTimeout、Promise的.then()或.catch()中,或原生事件处理器中有多个setState调用时,使用此技能。在编写任何flushSync调用之前使用它——这里的决策树可防止不必要的flushSync过度使用。在修复因React 18升级后中间状态断言导致的测试失败时,也使用此技能。
这是公开 Agent Skill 的中文说明,由采集翻译或编辑润色,完整内容以上游 SKILL.md 为准。适用于 Cursor / Claude Code / Codex / Gemini。 打开上游 SKILL.md
安装
通用(npx skills)
npx skills add github/awesome-copilot -s react18-batching-patterns
Cursor
把该 Skill 复制到项目的 .cursor/skills/react18-batching-patterns/ 目录
Claude Code
npx skills add github/awesome-copilot -a claude-code -s react18-batching-patterns