56 results available
Sign in
Skills directory

react19-source-patterns

github

·

Last changed
Hardened

This skill has been hardened by Chainguard

Last changed

This version passed the hardening gate. Hardening applied 21 targeted changes and preserved all other text. Classified findings before hardening: 0. Classified findings closed: 0. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 12. Review findings remaining: 2.


Open before hardening

None

Open after hardening

None


Expand
File
Group
Subtype
Severity
Status

No findings available

0 findings


SKILL.md

React 19 Source Migration Patterns

Reference for every source-file migration required for React 19.

Apply these migrations only to the project source files the team owns. Leave installed third party packages, vendored code, build output, and generated files unchanged. Confirm with the user before rewriting many files at once.

Quick Reference Table

PatternActionReference

ReactDOM.render(...)

→ createRoot().render()

See references/api-migrations.md

ReactDOM.hydrate(...)

→ hydrateRoot(...)

See references/api-migrations.md

unmountComponentAtNode

→ root.unmount()

Keep the root returned by createRoot or hydrateRoot so unmount can be called on it. See references/api-migrations.md

ReactDOM.findDOMNode

→ direct ref

Attach a ref to the specific DOM element, passing ref as a prop for function children, and flag unclear targets for manual review. See references/api-migrations.md

forwardRef(...) wrapper

→ ref as direct prop

See references/api-migrations.md

Component.defaultProps = {} on function components

→ ES6 default params. Class components still support defaultProps in React 19, so keep them as written

See references/api-migrations.md

useRef() no arg

→ useRef(null)

Inline fix: add null for DOM element refs. For refs that hold values rather than elements, keep the existing undefined behavior if code checks for undefined

Legacy Context

→ createContext

Legacy Context API Removed section in references/api-migrations.md

String refs this.refs.x

→ createRef()

String Refs Removed section in references/api-migrations.md

import React from 'react' (unused)

Remove

Only if no React. usage in file and the build config uses the automatic JSX runtime. Keep it in JSX files under the classic runtime

PropTypes Rule

Do not remove .propTypes assignments. The prop-types package only validates when its check function is called manually, and React 19 never runs component propTypes checks. React 19 only removes the built-in runtime checking from the React package, and 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.

Install

Install with chainctl
chainctl skill install public/github/react19-source-patterns:latest
Get started with chainctl
View source

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream sourcehttps://github.com/github/awesome-copilot
Upstream commit2201a49dd6f972ac4f685d03361d58c9c9206690
OCI reference

skills.chainreg.biz/public/github.com/github/skills/react19-source-patterns:latest

License

MIT

Files

HARDENING.md

LICENSE

SKILL.md

references/api-migrations.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.