Skip to content

Whole page component re-renders (unmounts) when route changes #54934

@opr-inzn

Description

@opr-inzn

Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/optimistic-panna-dgh66c

To Reproduce

Current vs. Expected behavior

Locally, this runs as expected and does not re-render the layout. When deployed to Vercel however, it re-renders the layout for whatever reason. Local version on Codesandbox: https://codesandbox.io/p/sandbox/optimistic-panna-dgh66c, deployed version on Vercel: https://clock-nextjs13.vercel.app/. This is not expected behaviour – I do not want to show my preloader again just because some of the dynamic metadata changed.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.6.0: Wed Jul  5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000
    Binaries:
      Node: 20.1.0
      npm: 9.8.0
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.20-canary.15
      eslint-config-next: 13.4.19
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.2.2
    Next.js Config:
      output: N/A

Which area(s) are affected? (Select all that apply)

App Router

Additional context

No response

NEXT-1609

Metadata

Metadata

Assignees

Labels

MetadataRelated to Next.js' Metadata API.bugIssue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.locked

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions