-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Closed
Labels
Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.Related to Next.js linking (e.g., <Link>) and navigation.bugIssue was opened via the bug report template.Issue was opened via the bug report template.locked
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Tue Apr 18 2023 19:37:14 GMT+0900
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 8.2.0
Relevant packages:
next: 13.3.1-canary.12
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-8g3pxu
To Reproduce
- Group routes with root layout, like multiple root layouts.
app
└── (group)
├── bar
│ └── page.tsx
├── foo
│ └── page.tsx
├── layout.tsx
└── page.tsx
- Click
<Link href='/foo'>go to /foo</Link>
, then page moves to/foo
. - Click
<Link href='/bar' prefetch={false}>go to /bar</Link>
, then only fetch/bar
, no page move. - And once that happened, clicking
foo
does the same thing asbar
.
Describe the Bug
Clicking <Link>
doesn't work as expected as above.
Expected Behavior
Clicking <Link>
should make page transition, not just fetching.
If add root layout outside of route group or allow prefetch then the issue is not be reproduced.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
honnmin and astateful
Metadata
Metadata
Assignees
Labels
Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.Related to Next.js linking (e.g., <Link>) and navigation.bugIssue was opened via the bug report template.Issue was opened via the bug report template.locked