github/awesome-copilot · react18-legacy-context · SKILL.md
React18旧版上下文迁移
提供React旧版上下文API(contextTypes、childContextTypes、getChildContext)到现代createContext API的完整迁移模式。在迁移类组件中的旧版上下文时使用此技能——这始终是跨文件迁移,需要同时更新提供者和所有消费者。在修改任何contextTypes或childContextTypes代码前使用,因为仅迁移提供者而不迁移消费者(或反之)会导致运行时错误。在编写任何上下文迁移代码前,务必先阅读此技能——这里的跨文件协调步骤可防止最常见的上下文迁移错误。
这是公开 Agent Skill 的中文说明,由采集翻译或编辑润色,完整内容以上游 SKILL.md 为准。适用于 Cursor / Claude Code / Codex / Gemini。 打开上游 SKILL.md
安装
通用(npx skills)
npx skills add github/awesome-copilot -s react18-legacy-context
Cursor
把该 Skill 复制到项目的 .cursor/skills/react18-legacy-context/ 目录
Claude Code
npx skills add github/awesome-copilot -a claude-code -s react18-legacy-context