github/awesome-copilot · react18-string-refs · SKILL.md

React18字符串引用迁移

提供React字符串引用(ref="name" + this.refs.name)到类组件中React.createRef()的精确迁移模式。在迁移字符串引用时使用此技能,包括单个元素引用、组件中的多个引用、列表中的引用、回调引用以及传递给子组件的引用。在编写任何引用迁移代码之前,务必使用此技能——列表中的多引用模式特别棘手,此技能可防止最常见的错误。适用于React 18.3.1迁移(字符串引用警告)和React 19迁移(字符串引用移除)。

★ 38154 质量 94.0 许可证 MIT 前端 generic

这是公开 Agent Skill 的中文说明,由采集翻译或编辑润色,完整内容以上游 SKILL.md 为准。适用于 Cursor / Claude Code / Codex / Gemini。 打开上游 SKILL.md

安装

通用(npx skills)

npx skills add github/awesome-copilot -s react18-string-refs

Cursor

把该 Skill 复制到项目的 .cursor/skills/react18-string-refs/ 目录

Claude Code

npx skills add github/awesome-copilot -a claude-code -s react18-string-refs

返回目录