Skip to content

Commit

Permalink
Mark interrupted renders as prewarm if they were already suspended
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Nov 21, 2024
1 parent ae8bb13 commit f03f459
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,18 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
previousRenderStartTime > 0
) {
setCurrentTrackFromLanes(workInProgressRootRenderLanes);
logInterruptedRenderPhase(previousRenderStartTime, renderStartTime);
if (
workInProgressRootExitStatus === RootSuspended ||
workInProgressRootExitStatus === RootSuspendedWithDelay
) {
// If the root was already suspended when it got interrupted and restarted,
// then this is considered a prewarm and not an interrupted render because
// we couldn't have shown anything anyway so it's not a bad thing that we
// got interrupted.
logSuspendedRenderPhase(previousRenderStartTime, renderStartTime);
} else {
logInterruptedRenderPhase(previousRenderStartTime, renderStartTime);
}
finalizeRender(workInProgressRootRenderLanes, renderStartTime);
}

Expand Down

0 comments on commit f03f459

Please sign in to comment.