[Fiber] Fix missing render times when we cancel a pending commit (#31065)

This commit is contained in:
Sebastian "Sebbie" Silbermann 2024-09-26 00:20:03 +02:00 committed by GitHub
parent 0f1856c49f
commit 778e1ed2e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -1308,6 +1308,8 @@ function commitRootWhenReady(
updatedLanes,
suspendedRetryLanes,
SUSPENDED_COMMIT,
completedRenderStartTime,
completedRenderEndTime,
),
);
const didAttemptEntireTree = !didSkipSuspendedSiblings;
@ -3001,8 +3003,6 @@ function commitRoot(
ReactSharedInternals.T = prevTransition;
setCurrentUpdatePriority(previousUpdateLanePriority);
}
return null;
}
function commitRootImpl(