Skip to content

Commit c6c96e9

Browse files
committed
Finalize render when root did not complete or suspended with delay
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.
1 parent 2ea0bd1 commit c6c96e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,9 @@ export function performWorkOnRoot(
938938
}
939939
break;
940940
} else if (exitStatus === RootDidNotComplete) {
941+
if (enableProfilerTimer && enableComponentPerformanceTrack) {
942+
finalizeRender(lanes, now());
943+
}
941944
// The render unwound without completing the tree. This happens in special
942945
// cases where need to exit the current render without producing a
943946
// consistent tree or committing.
@@ -1130,6 +1133,9 @@ function finishConcurrentRender(
11301133
// This is a transition, so we should exit without committing a
11311134
// placeholder and without scheduling a timeout. Delay indefinitely
11321135
// until we receive more data.
1136+
if (enableProfilerTimer && enableComponentPerformanceTrack) {
1137+
finalizeRender(lanes, now());
1138+
}
11331139
const didAttemptEntireTree =
11341140
!workInProgressRootDidSkipSuspendedSiblings;
11351141
markRootSuspended(

0 commit comments

Comments
 (0)