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

React19 compatibility #2260

Open
connectplatform opened this issue Dec 8, 2024 · 5 comments
Open

React19 compatibility #2260

connectplatform opened this issue Dec 8, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@connectplatform
Copy link

Describe the feature you'd like:

Please modify package compatibility to React v19. Right now I get this:
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error react@"^19.0.0" from the root project
npm error peer react@">=18.0" from @react-three/[email protected]
npm error node_modules/@react-three/fiber
npm error @react-three/fiber@"^8.17.10" from the root project
npm error peer @react-three/fiber@"^8" from @react-three/[email protected]
npm error node_modules/@react-three/drei
npm error @react-three/drei@"^9.119.0" from the root project
npm error 6 more (expo, @expo/dom-webview, react-native-webview, ...)
npm error
npm error Could not resolve dependency:
npm error peer react@"^18" from @react-three/[email protected]
npm error node_modules/@react-three/drei
npm error @react-three/drei@"^9.119.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Suggested implementation:

please add "^18.0.0 || ^19.0.0"

@connectplatform connectplatform added the enhancement New feature or request label Dec 8, 2024
@abernier
Copy link
Member

abernier commented Dec 8, 2024

i think this is intended, from what i know, r3f is not (yet) React 19 compatible

r3f v9 will be, but not yet released

@viktaur
Copy link

viktaur commented Dec 8, 2024

What can we do to fix this in the meantime?

@abernier
Copy link
Member

abernier commented Dec 8, 2024

What can we do to fix this in the meantime?

you can keep r3f v8 and react 18 (until v9 + updated drei are here)

@raulrpearson
Copy link

@viktaur, they recently added this comment to the r3f readme:

Warning

R3F v8 is not compatible with React 19 or Next 15, which uses React 19. Use the R3F v9 RC instead which can be installed with @react-three/fiber@rc.

Note

While we work on R3F v9 you can track compatibility of different libraries and common workarounds here.

@sxxov
Copy link

sxxov commented Dec 11, 2024

related: #2213

i've found that forcing drei to work with r3f's v9 rc doesn't work out-of-the-box, due to the shape of the internal .__r3f object structure changing in v9. manually patching them seemed to get me 90% of the way there though, with most utilities just working post-patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants