Skip to content

Commit 6c9271d

Browse files
committed
Track keyPath when rendering through a SuspenseBoundary
1 parent dab6e42 commit 6c9271d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-server/src/ReactFizzServer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,8 @@ function renderSuspenseBoundary(
737737
props: Object,
738738
): void {
739739
pushBuiltInComponentStackInDEV(task, 'Suspense');
740+
741+
const prevKeyPath = task.keyPath;
740742
const parentBoundary = task.blockedBoundary;
741743
const parentSegment = task.blockedSegment;
742744

@@ -798,6 +800,7 @@ function renderSuspenseBoundary(
798800
newBoundary.resources,
799801
);
800802
}
803+
task.keyPath = keyPath;
801804
try {
802805
// We use the safe form because we don't handle suspending here. Only error handling.
803806
renderNode(request, task, content, -1);
@@ -851,6 +854,7 @@ function renderSuspenseBoundary(
851854
}
852855
task.blockedBoundary = parentBoundary;
853856
task.blockedSegment = parentSegment;
857+
task.keyPath = prevKeyPath;
854858
}
855859

856860
// We create suspended task for the fallback because we don't want to actually work

0 commit comments

Comments
 (0)