VVersions.dev

Upgrade to React 19

React 19 is a recommended upgrade for most apps already on React 18. The risk is concentrated in removed legacy APIs (string refs, legacy context, function-component propTypes/defaultProps, findDOMNode) and test tooling.

Version upgradeDifficulty: moderateEffort: 0.5–3 days for a typical appmedium risk

Last verified · Updated May 22, 2026

React 19 is a recommended upgrade for apps already on React 18. Most breakage comes from removed legacy APIs and incompatible test tooling — not from rewriting your components. Budget half a day to three days depending on enzyme/string-ref usage.

Who should upgrade

  • Apps on React 18 wanting Actions, form hooks, and improved hydration error messages.
  • Libraries that want to drop forwardRef boilerplate.
  • Teams on React 16/17 should first reach React 18, then 19.

Who should wait

  • Apps with heavy enzyme test suites until those are migrated to React Testing Library.
  • Apps blocked by a critical third-party library without a React 19-compatible release.

What changed

  • Actions: async transitions with built-in pending/error state.
  • New hooks: useActionState, useFormStatus, useOptimistic, and use().
  • ref is a regular prop; forwardRef is being deprecated.
  • Removed: string refs, legacy context, function-component propTypes/defaultProps, findDOMNode, and the shallow renderer.
  • Improved hydration error diffs.
Breaking changes concentrate in legacy APIs

The upgrade rarely touches modern function components. It touches code using string refs, legacy context, findDOMNode, and propTypes/defaultProps on function components. Inspect for those first.

Fast path for apps already on React 18
# 1. Bump React$ npm install react@19 react-dom@19# 2. Run the official migration codemod recipe$ npx codemod@latest react/19/migration-recipe# 3. Typecheck + test$ npm run typecheck && npm test -- --watch=false

Compatibility matrix

ConcernReact 18React 19
forwardRefRequired for ref forwardingOptional — ref is a prop
propTypes (function comps)Runtime-checkedIgnored / removed
String refsDeprecatedRemoved
EnzymeUnsupportedUnsupported
Server ComponentsExperimentalStable (framework-dependent)
Migration executionAI-assisted migration workflow
Upgrade this app to React 19. First inspect for removed APIs (string refs, legacy context, function-component propTypes/defaultProps, findDOMNode, shallow renderer). Then bump react/react-dom, run `npx codemod@latest react/19/migration-recipe`, fix the inspection findings, and resolve type errors. Run typecheck, lint, and tests after each step and report before continuing.

Safety: Incremental edits only. Pause for review after the codemod and after each API replacement.

PR review checklist

  • react and react-dom are on the same 19.x version
  • No string refs, legacy context, or findDOMNode remain
  • forwardRef wrappers were only removed where the codemod is safe
  • Tests no longer use the shallow renderer or enzyme
  • No new React console warnings in test output

Rollback strategy

  • Keep the version bump, codemod, and manual fixes in separate commits.
  • Revert to react@18 react-dom@18 and reinstall if a blocking third-party incompatibility appears.
  • Hold the upgrade behind a release branch until the full test suite is green.

Common errors

  • 'X is not a function' after findDOMNode removal — switch to a ref.
  • Hydration mismatch warnings — see the fix-react-hydration-errors workflow.
  • Type errors on ref props after dropping forwardRef.

Official sources

  • Official docsReact v19react.devreliability 98%

    Backs the breaking-change and migration-step claims.

  • GitHub releaseReact 19.0.0 releasefacebook/reactreliability 92%

    Backs the breaking-change and migration-step claims.

  • Migration guideReact 19 Upgrade Guidereact.devreliability 98%

    Backs the breaking-change and migration-step claims.

Frequently asked questions

Is React 19 a hard upgrade?

For modern React 18 apps it is usually straightforward — the official codemod handles most mechanical changes. The effort scales with how much legacy API surface (string refs, enzyme, findDOMNode) your codebase still uses.

Do I need to rewrite components to use Actions?

No. Actions and the new form hooks are opt-in. You can upgrade to React 19 without adopting them and migrate forms incrementally.