Skip to content

Commit 778e1ed

Browse files
authored
[Fiber] Fix missing render times when we cancel a pending commit (#31065)
1 parent 0f1856c commit 778e1ed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3401,7 +3401,7 @@ export function suspendResource(
34013401
}
34023402
}
34033403

3404-
export function waitForCommitToBeReady(): null | (Function => Function) {
3404+
export function waitForCommitToBeReady(): null | ((() => void) => () => void) {
34053405
if (suspendedState === null) {
34063406
throw new Error(
34073407
'Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug.',

packages/react-reconciler/src/ReactFiberWorkLoop.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,8 @@ function commitRootWhenReady(
13081308
updatedLanes,
13091309
suspendedRetryLanes,
13101310
SUSPENDED_COMMIT,
1311+
completedRenderStartTime,
1312+
completedRenderEndTime,
13111313
),
13121314
);
13131315
const didAttemptEntireTree = !didSkipSuspendedSiblings;
@@ -3001,8 +3003,6 @@ function commitRoot(
30013003
ReactSharedInternals.T = prevTransition;
30023004
setCurrentUpdatePriority(previousUpdateLanePriority);
30033005
}
3004-
3005-
return null;
30063006
}
30073007

30083008
function commitRootImpl(

0 commit comments

Comments
 (0)