Index of every page on this site: llms.txt
All skills
github avatar

/react19-source-patterns

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

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

Description uses 1.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈138 characters, or 1.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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 rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo4 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    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.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub 4 days ago.

Activeupdated 7 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.