Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recently re-introduced unique "key" prop warnings #70807

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 33 additions & 37 deletions packages/next/src/server/app-render/create-component-tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -631,28 +631,25 @@ async function createComponentTreeInternal({
)

segmentNode = (
<>
<NotFoundBoundary
notFound={
<>
{layerAssets}
{notfoundClientSegment}
</>
}
>
{layerAssets}
{clientSegment}
</NotFoundBoundary>
</>
<NotFoundBoundary
key={cacheNodeKey}
notFound={
<>
{layerAssets}
{notfoundClientSegment}
</>
}
>
{layerAssets}
{clientSegment}
</NotFoundBoundary>
)
} else {
segmentNode = (
<>
<NotFoundBoundary>
{layerAssets}
{clientSegment}
</NotFoundBoundary>
</>
<NotFoundBoundary key={cacheNodeKey}>
{layerAssets}
{clientSegment}
</NotFoundBoundary>
)
}
} else {
Expand Down Expand Up @@ -680,24 +677,23 @@ async function createComponentTreeInternal({
// We should instead look into handling the fallback behavior differently in development mode so that it doesn't
// rely on the `NotFound` behavior.
segmentNode = (
<>
<NotFoundBoundary
notFound={
NotFound ? (
<>
{layerAssets}
<SegmentComponent params={params}>
{notFoundStyles}
<NotFound />
</SegmentComponent>
</>
) : undefined
}
>
{layerAssets}
{serverSegment}
</NotFoundBoundary>
</>
<NotFoundBoundary
key={cacheNodeKey}
notFound={
NotFound ? (
<>
{layerAssets}
<SegmentComponent params={params}>
{notFoundStyles}
<NotFound />
</SegmentComponent>
</>
) : undefined
}
>
{layerAssets}
{serverSegment}
</NotFoundBoundary>
)
} else {
segmentNode = (
Expand Down
Loading