mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### 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
11 lines
247 B
TypeScript
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>
|
|
)
|
|
}
|