Skip to content

Commit 3e9714d

Browse files
committed
Fix missing keys in Fragments in arrays
1 parent abeabe4 commit 3e9714d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/next/src/server/app-render/app-render.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,11 @@ async function getRSCPayload(
522522
typeof varyHeader === 'string' && varyHeader.includes(NEXT_URL)
523523

524524
const initialHead = (
525-
<>
525+
<React.Fragment key="initial-head">
526526
<NonIndex ctx={ctx} />
527527
{/* Adding requestId as react key to make metadata remount for each render */}
528528
<MetadataTree key={ctx.requestId} />
529-
</>
529+
</React.Fragment>
530530
)
531531

532532
return {

packages/next/src/server/app-render/create-component-tree.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ async function createComponentTreeInternal({
618618
return [
619619
actualSegment,
620620
parallelRouteCacheNodeSeedData,
621-
<>
621+
<React.Fragment key="segment-wrapper">
622622
{segmentElement}
623623
{/* This null is currently critical. The wrapped Component can render null and if there was not fragment
624624
surrounding it this would look like a pending tree data state on the client which will cause an error
@@ -629,7 +629,7 @@ async function createComponentTreeInternal({
629629
null it will look like `null` (the array is elided) and this is what confuses the client router.
630630
TODO-APP update router to use a Symbol for partial tree detection */}
631631
{null}
632-
</>,
632+
</React.Fragment>,
633633
loadingData,
634634
]
635635
}

0 commit comments

Comments
 (0)