mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[Fizz] Clean up the replay nodes if we're already rendered past an element (#33581)
This commit is contained in:
parent
c8822e926b
commit
79d9aed7ed
7
packages/react-server/src/ReactFizzServer.js
vendored
7
packages/react-server/src/ReactFizzServer.js
vendored
|
|
@ -3099,6 +3099,9 @@ function replayElement(
|
||||||
if (task.node === currentNode) {
|
if (task.node === currentNode) {
|
||||||
// This same element suspended so we need to pop the replay we just added.
|
// This same element suspended so we need to pop the replay we just added.
|
||||||
task.replay = replay;
|
task.replay = replay;
|
||||||
|
} else {
|
||||||
|
// We finished rendering this node, so now we can consume this slot.
|
||||||
|
replayNodes.splice(i, 1);
|
||||||
}
|
}
|
||||||
throw x;
|
throw x;
|
||||||
}
|
}
|
||||||
|
|
@ -4127,6 +4130,8 @@ function renderNode(
|
||||||
const segment = task.blockedSegment;
|
const segment = task.blockedSegment;
|
||||||
if (segment === null) {
|
if (segment === null) {
|
||||||
// Replay
|
// Replay
|
||||||
|
task = ((task: any): ReplayTask); // Refined
|
||||||
|
const previousReplaySet: ReplaySet = task.replay;
|
||||||
try {
|
try {
|
||||||
return renderNodeDestructive(request, task, node, childIndex);
|
return renderNodeDestructive(request, task, node, childIndex);
|
||||||
} catch (thrownValue) {
|
} catch (thrownValue) {
|
||||||
|
|
@ -4166,6 +4171,7 @@ function renderNode(
|
||||||
task.keyPath = previousKeyPath;
|
task.keyPath = previousKeyPath;
|
||||||
task.treeContext = previousTreeContext;
|
task.treeContext = previousTreeContext;
|
||||||
task.componentStack = previousComponentStack;
|
task.componentStack = previousComponentStack;
|
||||||
|
task.replay = previousReplaySet;
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
task.debugTask = previousDebugTask;
|
task.debugTask = previousDebugTask;
|
||||||
}
|
}
|
||||||
|
|
@ -4199,6 +4205,7 @@ function renderNode(
|
||||||
task.keyPath = previousKeyPath;
|
task.keyPath = previousKeyPath;
|
||||||
task.treeContext = previousTreeContext;
|
task.treeContext = previousTreeContext;
|
||||||
task.componentStack = previousComponentStack;
|
task.componentStack = previousComponentStack;
|
||||||
|
task.replay = previousReplaySet;
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
task.debugTask = previousDebugTask;
|
task.debugTask = previousDebugTask;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user