Skip to content

Next 16 Portals does not replace contents with cacheComponents #85279

@khuezy

Description

@khuezy

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.

  1. npm run dev
  2. go to localhost:3000
  3. Click on 'a', see the portal at the top
  4. 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

N/A

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions