Reference for React 19 source-file migration patterns, including API changes, ref handling, and context updates.
Reference for every source-file migration required for React 19.
| 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 |
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.
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.
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/react19-source-patterns · pinned to the source commit
# Run from your project root
git clone https://github.com/github/awesome-copilot.git .skillboard-tmp
git -C .skillboard-tmp checkout f11a4e441c5ff061b4f8ae37952be8c602e4034e
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/skills/react19-source-patterns" ".claude/skills/"
rm -rf .skillboard-tmpReview the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
sudo apt update && sudo apt install -y gitnpm install -g @anthropic-ai/claude-code# Run from your project root
git clone https://github.com/github/awesome-copilot.git .skillboard-tmp
git -C .skillboard-tmp checkout f11a4e441c5ff061b4f8ae37952be8c602e4034e
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/skills/react19-source-patterns" ".claude/skills/"
rm -rf .skillboard-tmpDestination: .claude/skills/react19-source-patterns
Scanner static-checks@0.1.0 · commit f11a4e441c5f. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.