Skip to content

Commit

Permalink
Finalize render when root did not complete or suspended with delay
Browse files Browse the repository at this point in the history
This is a special case which ends with no on-going renders but also doesn't
commit. So we need to finalize the render so that we know that we can't.

This should probably be handled more like a suspended yield instead.
  • Loading branch information
sebmarkbage committed Nov 13, 2024
1 parent b55ad40 commit f24eed0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,9 @@ export function performWorkOnRoot(
}
break;
} else if (exitStatus === RootDidNotComplete) {
if (enableProfilerTimer && enableComponentPerformanceTrack) {
finalizeRender(lanes, now());
}
// The render unwound without completing the tree. This happens in special
// cases where need to exit the current render without producing a
// consistent tree or committing.
Expand Down Expand Up @@ -1130,6 +1133,9 @@ function finishConcurrentRender(
// This is a transition, so we should exit without committing a
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
if (enableProfilerTimer && enableComponentPerformanceTrack) {
finalizeRender(lanes, now());
}
const didAttemptEntireTree =
!workInProgressRootDidSkipSuspendedSiblings;
markRootSuspended(
Expand Down

0 comments on commit f24eed0

Please sign in to comment.