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

react 19 (v9) createPortal bug #3486

Open
bbohlender opened this issue Mar 6, 2025 · 3 comments
Open

react 19 (v9) createPortal bug #3486

bbohlender opened this issue Mar 6, 2025 · 3 comments

Comments

@bbohlender
Copy link
Contributor

Hey :)

An issue was reported to me that I identified to be a bug in react-three/fiber. I've created an reproduction repo here: https://github.com/bbohlender/r3f-portal-bug

Steps to reproduce

  1. npm install & npm run dev
  2. notice that no mesh is bound to the camera (hotpink cube)
  3. change react, react-dom, react-three/fiber and react-three/drei to the according react 18 deps
  4. run npm install again, clear the vite deps, and run npm run dev again
  5. notice that the mesh is now visible and bound to the camera (hotpink cube)

The issue seems to be that when the container of createPortal changes, the children are still bound to the previous container, which only happens after the upgrade to react 19 (including the react-three/fiber and drei deps).

Let me know if I can help with anything :)

@krispya
Copy link
Member

krispya commented Mar 7, 2025

This may be fixed by: #3488

@wrangelvid
Copy link

The PR fixed another related bug, but this issue still persists.

@krispya
Copy link
Member

krispya commented Mar 8, 2025

It looks like my fix didn't resolve the issue, just the simple test I set up. I'll investigate more this weekend.

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