Link to the code that reproduces this issue
https://github.com/khuezy/next16-portalbug
To Reproduce
Repro steps are in the README of the link above.
- npm run dev
- go to localhost:3000
- Click on 'a', see the portal at the top
- Click on 'b', see the portal at the top, it does not replace A's portal.
Current vs. Expected behavior
When using React Portals, I expect the contents of the portal to be replaced with the new content.
This works on Next 15 and below but is broken in Next 16
Provide environment information
Which area(s) are affected? (Select all that apply)
cacheComponents
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
No response