-
Notifications
You must be signed in to change notification settings - Fork 26k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
router: add layout and other file supports to parallel routes (#51413)
This PR fixes a bug in which the layout files were not picked up if they were direct children of a parallel route slot. Note: there's a bunch of other files that I've used for debugging that are not used for the test but I'm leaving them for future me. link NEXT-969
- Loading branch information
1 parent
bd46684
commit 5b7b91f
Showing
11 changed files
with
78 additions
and
14 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
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/(.)sub/[slug]/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 'intercepted parallel layout slug' | ||
} |
8 changes: 8 additions & 0 deletions
8
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/(.)sub/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 function Layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<> | ||
<h1> intercepted layout</h1> | ||
{children} | ||
</> | ||
) | ||
} |
8 changes: 8 additions & 0 deletions
8
...app-dir/parallel-routes-and-interception/app/parallel-layout/@groupslot/(slot)/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 function Layout({ children }) { | ||
return ( | ||
<div> | ||
<h1>Parallel group slot Layout</h1> | ||
{children} | ||
</div> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
...e/app-dir/parallel-routes-and-interception/app/parallel-layout/@groupslot/(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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page() { | ||
return 'group slot children' | ||
} |
8 changes: 8 additions & 0 deletions
8
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/@slot/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 function Layout({ children }) { | ||
return ( | ||
<div> | ||
<h1 id="parallel-layout">parallel layout</h1> | ||
{children} | ||
</div> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page() { | ||
return 'slot children' | ||
} |
13 changes: 13 additions & 0 deletions
13
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/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,13 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Layout({ children, slot, groupslot }) { | ||
return ( | ||
<div> | ||
<h1>Main Layout</h1> | ||
{children} | ||
<div id="slot">{slot}</div> | ||
<div id="groupslot">{groupslot}</div> | ||
<Link href="/parallel-layout/sub/route">/sub/route</Link> | ||
</div> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/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 'children' | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-layout/sub/[slug]/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 'parallel layout slug' | ||
} |
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