Files
Zack TannerandGitHub c9321c72c9 parallel routes: support multi-slot layouts (#61115)
### What?
When using layouts in multiple parallel route slots, only 1 of the
layouts would render.

### Why?
The `resolveParallelSegments` logic responsible for populating the
loader tree was incorrectly bailing if it found another parallel route
that matched a page component.

### How?
I did my best to update this loader code with some more comments to make
it a bit easier to reason about, and also made some slight refactors.
But the gist of the fix is just ensuring that each parallel route (that
isn't a direct match on the `children` slot) is resolved as an array, so
that when the subtree is created, it doesn't skip over the slot.

Fixes #58506
Fixes #59463

Closes NEXT-2222
2024-01-26 11:46:23 -08:00

11 lines
247 B
TypeScript

export default function Layout({ children, bar, foo }) {
return (
<div>
<h1>Nested Layout</h1>
<div id="nested-children">{children}</div>
<div id="foo-slot">{foo}</div>
<div id="bar-slot">{bar}</div>
</div>
)
}