Skip to content

Pin react peerDependency to the exact synced renderer version - #58298

Open
ram-devv1 wants to merge 1 commit into
react:mainfrom
ram-devv1:fix-57079-exact-react-peer
Open

Pin react peerDependency to the exact synced renderer version#58298
ram-devv1 wants to merge 1 commit into
react:mainfrom
ram-devv1:fix-57079-exact-react-peer

Conversation

@ram-devv1

Copy link
Copy Markdown

Summary:

Fixes #57079.

react-native@0.85.3 declares "react": "^19.2.3" in peerDependencies, so package managers happily install e.g. react@19.2.6 — but the embedded renderer only supports the exact React version it was synced with (the 0.85.x Paper bundle throws Incompatible React versions unless React.version === "19.2.3", and the Fabric bundle still embeds a pinned version: "19.2.3"). Install succeeds, launch crashes.

This PR pins packages/react-native/package.json peerDependencies.react to the exact synced version (19.2.3, matching the workspace-root dev pin, the helloworld template, and the renderer bundle), restoring the pre-0.76 exact-pin practice (0.74.0 shipped "react": "18.2.0"). A mismatched React now surfaces as an install-time peer warning instead of a runtime crash. It also adds a monorepo consistency test so future React syncs cannot silently reintroduce the drift.

Changelog:

[GENERAL] [FIXED] - Pin react-native peerDependency on react to the exact synced renderer version so installs reject React versions the renderer does not support (fixes #57079)

Test Plan:

  • yarn jest scripts/monorepo-tests/__tests__/check-packages-test.js — 6/6 pass, including the new the react-native peer for react must exactly match the synced renderer version test.
  • Negative control: temporarily restored ^19.2.3 and re-ran the new test — it fails as expected; re-applied the fix and it passes.
  • yarn eslint --max-warnings 0 scripts/monorepo-tests/__tests__/check-packages-test.js — clean.
  • prettier --check on both changed files — clean.
  • Verified against published tarballs: npm view react-native@0.85.3 peerDependencies shows the old ^19.2.3, and the 0.85.3 tarball's ReactNativeRenderer-dev.js contains the exact 19.2.3 runtime check; semver simulation confirms 19.2.6 satisfies ^19.2.3 but not 19.2.3.
  • Could not run: native builds / RNTester bundling (no device toolchain in this environment); change is metadata + a Node-only test, no runtime code touched.

Fixes react#57079. The ^19.2.3 peer range lets package managers install a React
that the embedded renderer rejects at runtime. Pin the peer to the exact
synced version and add a monorepo test keeping peer, dev pin, and renderer
bundle in sync.
@meta-cla

meta-cla Bot commented Sep 3, 2026

Copy link
Copy Markdown

Hi @ram-devv1!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-native@0.85.3 peerDependencies allow react@19.2.6 but embedded renderer requires exact 19.2.3

2 participants