[Fizz] Pass task.childIndex in retryReplayTask (#27594)
This was missed that we track the child index on the task. The equivalent in retryRenderTask already has this. The effect is that a lazy node that suspends gets its child index reset to -1 even though it should resume in the index it left off.
Sebastian Markbåge committed
Oct 25, 2023 at 23:20 UTC
8c8ee9ee618eace9199b7c80f4cd2d6f20ecfb73
1 file changed
+7
-1
packages/react-server/src/ReactFizzServer.js
+7
-1
@@ -3476,7 +3476,13 @@ function retryReplayTask(request: Request, task: ReplayTask): void {
3476
const prevThenableState = task.thenableState;
3477
task.thenableState = null;
3478
3479
- renderNodeDestructive(request, task, prevThenableState, task.node, -1);
3479
+ renderNodeDestructive(
3480
+ request,
3481
+ task,
3482
+ prevThenableState,
3483
+ task.node,
3484
+ task.childIndex,
3485
+ );
3486
3487
if (task.replay.pendingTasks === 1 && task.replay.nodes.length > 0) {
3488
throw new Error(