Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes in React experimental branch #3222

Closed
Tracked by #2338
jackpope opened this issue Mar 27, 2024 · 3 comments
Closed
Tracked by #2338

Breaking changes in React experimental branch #3222

jackpope opened this issue Mar 27, 2024 · 3 comments

Comments

@jackpope
Copy link

React is preparing changes, including some breaking, for the next major release. There are changes to the Reconciler that break @react-three/fiber.

To repro:

  • Install react and react-dom @experimental
  • Load @react-three/fiber demo
  • Observe error

sandbox: https://codesandbox.io/p/sandbox/react-three-fiber-experimental-9hqh35

To prepare for the new versions, @react-three/fiber should build against the latest changes by upgrading react-reconciler, which requires new methods since 0.27.0. See all

@CodyJasonBennett
Copy link
Member

Thanks for looking out. We're aware of this and plan to upgrade our reconciler alongside React 19 with our v9 release. I can make a PR for this shortly.

@lourd
Copy link

lourd commented Aug 17, 2024

You're probably already aware of this, but adding my findings in case not. When trying React v19 on my personal site with a couple R3F sketches, they fail at runtime during dev with

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')

Call Stack
$$$reconciler
node_modules/.pnpm/react-reconciler@0.27.0_react@19.0.0-rc-f994737d14-20240522/node_modules/react-reconciler/cjs/react-reconciler.development.js (498:1)
createRenderer
node_modules/.pnpm/@react-three+fiber@8.17.5_react-dom@19.0.0-rc-f994737d14-20240522_react@19.0.0-rc-f994737d14-_5tpfayefndxx6u5t5hvu2nrgoe/node_modules/@react-three/fiber/dist/events-a5fc3e51.esm.js (223:32)

And at build time with

Failed to compile.

./node_modules/.pnpm/its-fine@1.1.1_react@19.0.0-rc-f994737d14-20240522/node_modules/its-fine/dist/index.js
Attempted import error: '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' is not exported from 'react' (imported as 'React').

Import trace for requested module:
./node_modules/.pnpm/its-fine@1.1.1_react@19.0.0-rc-f994737d14-20240522/node_modules/its-fine/dist/index.js
./node_modules/.pnpm/@react-three+fiber@8.17.5_react-dom@19.0.0-rc-f994737d14-20240522_react@19.0.0-rc-f994737d14-_5tpfayefndxx6u5t5hvu2nrgoe/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js

Let me know if there's any way I can help!

@CodyJasonBennett
Copy link
Member

React 19 is a breaking change and requires an upgrade for libraries to support it, with renderers requiring an extensive refactor and type changes. For R3F and the rest of the pmndrs ecosystem, we can't release support to stable until React 19 itself is out, which is frozen in RC due to unintended regressions with suspense and reconciliation. You can find a v9 alpha of R3F that supports React 19 as of the last RC with a migration guide, but I would not expect any haste in the ecosystem due to the lack of a timeline for React 19 stable. If you have any feedback during testing, I'd appreciate it in #2338, where we're tracking the v9 milestone. This issue has since been resolved, and am tracking minor cleanup upstream in facebook/react#28956.

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

No branches or pull requests

3 participants