-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
router: support layout/special files as direct children of parallel r…
…outes (#51604) follow up on #51413 where I kinda forgot to support parsing layout files in sub routes in a parallel segment. This should fix it by making sure that we check at all level of the app loader tree and by creating an implicit inner `children` for all parallel slot link NEXT-1301
- Loading branch information
1 parent
f6998e3
commit bc9ed9d
Showing
7 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/@groupslot/default.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => null |
9 changes: 8 additions & 1 deletion
9
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/@slot/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Page() { | ||
return 'slot children' | ||
return ( | ||
<> | ||
<div>slot children</div> | ||
<Link href="/parallel-layout/subroute">parallel subroute</Link> | ||
</> | ||
) | ||
} |
8 changes: 8 additions & 0 deletions
8
...2e/app-dir/parallel-routes-and-interception/app/parallel-layout/@slot/subroute/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default ({ children }) => { | ||
return ( | ||
<div> | ||
<h1 id="parallel-subroute">parallel subroute layout</h1> | ||
{children} | ||
</div> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
.../e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/@slot/subroute/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page() { | ||
return 'subroute children' | ||
} |
1 change: 1 addition & 0 deletions
1
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/default.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters