diff --git a/packages/react-reconciler/src/ReactFiberLane.js b/packages/react-reconciler/src/ReactFiberLane.js index 0aa580bfee051..b8c051def4eef 100644 --- a/packages/react-reconciler/src/ReactFiberLane.js +++ b/packages/react-reconciler/src/ReactFiberLane.js @@ -592,6 +592,10 @@ export function includesSyncLane(lanes: Lanes): boolean { return (lanes & (SyncLane | SyncHydrationLane)) !== NoLanes; } +export function isSyncLane(lanes: Lanes): boolean { + return (lanes & (SyncLane | SyncHydrationLane)) !== NoLanes; +} + export function includesNonIdleWork(lanes: Lanes): boolean { return (lanes & NonIdleLanes) !== NoLanes; } diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js index 91416c4f5949c..b576309dc84ab 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js @@ -1718,7 +1718,7 @@ function resetWorkInProgressStack() { function finalizeRender(lanes: Lanes, finalizationTime: number): void { if (enableProfilerTimer && enableComponentPerformanceTrack) { - if (includesBlockingLane(lanes)) { + if (includesSyncLane(lanes) || includesBlockingLane(lanes)) { clampBlockingTimers(finalizationTime); } if (includesTransitionLane(lanes)) { @@ -1737,7 +1737,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber { // restart so we need to clamp that. finalizeRender(workInProgressRootRenderLanes, renderStartTime); - if (includesBlockingLane(lanes)) { + if (includesSyncLane(lanes) || includesBlockingLane(lanes)) { logBlockingStart( blockingUpdateTime, blockingEventTime, diff --git a/packages/react-reconciler/src/ReactProfilerTimer.js b/packages/react-reconciler/src/ReactProfilerTimer.js index 8772d52f12bc6..cf3133524813e 100644 --- a/packages/react-reconciler/src/ReactProfilerTimer.js +++ b/packages/react-reconciler/src/ReactProfilerTimer.js @@ -10,7 +10,7 @@ import type {Fiber} from './ReactInternalTypes'; import type {Lane} from './ReactFiberLane'; -import {isTransitionLane, isBlockingLane} from './ReactFiberLane'; +import {isTransitionLane, isBlockingLane, isSyncLane} from './ReactFiberLane'; import {resolveEventType, resolveEventTimeStamp} from './ReactFiberConfig'; @@ -49,7 +49,7 @@ export function startUpdateTimerByLane(lane: Lane): void { if (!enableProfilerTimer || !enableComponentPerformanceTrack) { return; } - if (isBlockingLane(lane)) { + if (isSyncLane(lane) || isBlockingLane(lane)) { if (blockingUpdateTime < 0) { blockingUpdateTime = now(); blockingEventTime = resolveEventTimeStamp();