All skills
github avatar

/react19-source-patterns

@90921cc official
by githubgithub/awesome-copilot40k stars
5,040

Reference for React 19 source-file migration patterns, including API changes, ref handling, and context updates.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/react19-source-patterns

This session only. Nothing lands on disk.

SKILL.md

≈34 tokens always: the name and description. ≈453 when used: this file. ≈2.8k more on demand in 1 file.

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.

Source: SKILL.md on GitHub

No alerts15d4 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    The skill provides reference documentation and search patterns for migrating React applications to version 19. It includes safe shell commands for identifying outdated code patterns.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 90921cc. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 18 hours ago.

Activeupdated 5 months ago

README badge

README badge for github/awesome-copilot/react19-source-patterns

Provides before-and-after patterns for migrating React source files to React 19, covering ReactDOM API changes, ref handling, context updates, and PropTypes. Targets the specific migration workflows for `createRoot`, `forwardRef` removal, and legacy context conversion.

Generated from the current SKILL.md.

Does this skill cover all React 19 API changes?
It covers the most common source-file migrations: ReactDOM.render, forwardRef, refs, defaultProps, and legacy context. Edge cases and full before/after patterns are documented in the bundled references/api-migrations.md file.
Should I remove PropTypes from my codebase?
No. The skill advises keeping .propTypes assignments because the prop-types package still works as a standalone validator—React 19 only removes runtime checking, not the package itself.
Do I need to remove unused React imports?
Only if no React.* usage remains in the file. The skill tracks unused default imports separately from named imports like createRoot.
Does this handle useRef migration?
Yes. The skill requires adding null as an argument to useRef() calls that have no initial value (useRef(null) instead of useRef()).

Generated from the current SKILL.md. These answers refresh after source changes.