react19-source-patterns
What it does
This guide helps you update your React code for version 19. It shows how to change specific code parts that stopped working or moved in the new version.
When to use it
- ✓When updating your React project to version 19.
- ✓When a part of your React code stops working after the update.
- ✓To understand necessary changes in specific files.
Skill link
https://github.com/github/awesome-copilot/blob/main/skills/react19-source-patterns/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“How do I update ReactDOM.render for React 19?”
5 new skills a week. 1 minute to read.
How it works
The AI compares your old code with React 19's migration patterns. It suggests the exact changes needed for each code part, like replacing `ReactDOM.render` with `createRoot().render()`.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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.
FAQ
Do I need to remove `.propTypes`?
No, you don't need to remove `.propTypes`. They still work as validators, but React 19 no longer runs them automatically. It's good to keep them for documentation and tooling.
What are 'String refs'?
These are an old way to reference elements in React (e.g., `this.refs.myElement`). React 19 suggests using `createRef()` instead.
What about `useRef()` with no argument?
If you use `useRef()` without an initial value, React 19 asks you to add `null` as the argument, making it `useRef(null)`.
Details
Original description by the author
Reference for React 19 source-file migration patterns, including API changes, ref handling, and context updates.
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #7390
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
40kHelps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
acreadiness-assess
40kEnables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
acreadiness-generate-instructions
40kHelps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
acreadiness-policy
40kEnables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.