
react19-source-patterns
โ Officialโ 36,202by github ยท part of github/awesome-copilot
Reference for React 19 source-file migration patterns, including API changes, ref handling, and context updates.
This is the playbook your agent receives when the skill activates โ you don't need to read it to use the skill, but it's here to audit before installing.
React 19 Source Migration Patterns
Reference for every source-file migration required for React 19.
Quick Reference Table
| Pattern | Action | Reference |
|---|---|---|
ReactDOM.render(...) | โ createRoot().render() | See references/api-migrations.md |
ReactDOM.hydrate(...) | โ hydrateRoot(...) | See references/api-migrations.md |
unmountComponentAtNode | โ root.unmount() | Inline fix |
ReactDOM.findDOMNode | โ direct ref | Inline fix |
forwardRef(...) wrapper | โ ref as direct prop | See references/api-migrations.md |
Component.defaultProps = {} | โ ES6 default params | See references/api-migrations.md |
useRef() no arg | โ useRef(null) | Inline fix add null |
| Legacy Context | โ createContext | โ api-migrations.md#legacy-context |
String refs this.refs.x | โ createRef() | โ api-migrations.md#string-refs |
import React from 'react' (unused) | Remove | Only if no React. usage in file |
PropTypes Rule
Do not remove .propTypes assignments. The prop-types package still works as a standalone validator. React 19 only removes the built-in runtime checking from the React package the package itself remains valid.
Add this comment above any .propTypes block:
// NOTE: React 19 no longer runs propTypes validation at runtime.
// PropTypes kept for documentation and IDE tooling only.Read the Reference
For full before/after code for each migration, read references/api-migrations.md. It contains the complete patterns including edge cases for forwardRef with useImperativeHandle, defaultProps null vs undefined behavior, and legacy context provider/consumer cross-file migrations.
npx skills add github/awesome-copilot --skill "react19-source-patterns" --full-depthRun this in your project โ your agent picks the skill up automatically.
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.
Licensed under MITโ you can use, modify, and redistribute it under that license's terms.
View the full license file on GitHub โ