@@ -26,6 +26,7 @@ import type {
2626 Resource ,
2727 ViewTransitionInstance ,
2828 RunningViewTransition ,
29+ SuspendedState ,
2930} from './ReactFiberConfig' ;
3031import type { RootState } from './ReactFiberRoot' ;
3132import {
@@ -1379,6 +1380,7 @@ function finishConcurrentRender(
13791380 workInProgressRootInterleavedUpdatedLanes ,
13801381 workInProgressSuspendedRetryLanes ,
13811382 exitStatus ,
1383+ null ,
13821384 IMMEDIATE_COMMIT ,
13831385 renderStartTime ,
13841386 renderEndTime ,
@@ -1487,10 +1489,11 @@ function commitRootWhenReady(
14871489 subtreeFlags & ShouldSuspendCommit ||
14881490 ( subtreeFlags & BothVisibilityAndMaySuspendCommit ) ===
14891491 BothVisibilityAndMaySuspendCommit ;
1492+ let suspendedState : null | SuspendedState = null ;
14901493 if ( isViewTransitionEligible || maySuspendCommit || isGestureTransition ) {
14911494 // Before committing, ask the renderer whether the host tree is ready.
14921495 // If it's not, we'll wait until it notifies us.
1493- const suspendedState = startSuspendingCommit ( ) ;
1496+ suspendedState = startSuspendingCommit ( ) ;
14941497 // This will walk the completed fiber tree and attach listeners to all
14951498 // the suspensey resources. The renderer is responsible for accumulating
14961499 // all the load events. This all happens in a single synchronous
@@ -1541,6 +1544,7 @@ function commitRootWhenReady(
15411544 updatedLanes ,
15421545 suspendedRetryLanes ,
15431546 exitStatus ,
1547+ suspendedState ,
15441548 SUSPENDED_COMMIT ,
15451549 completedRenderStartTime ,
15461550 completedRenderEndTime ,
@@ -1564,6 +1568,7 @@ function commitRootWhenReady(
15641568 updatedLanes ,
15651569 suspendedRetryLanes ,
15661570 exitStatus ,
1571+ suspendedState ,
15671572 suspendedCommitReason ,
15681573 completedRenderStartTime ,
15691574 completedRenderEndTime ,
@@ -3287,6 +3292,7 @@ function commitRoot(
32873292 updatedLanes : Lanes ,
32883293 suspendedRetryLanes : Lanes ,
32893294 exitStatus : RootExitStatus ,
3295+ suspendedState : null | SuspendedState ,
32903296 suspendedCommitReason : SuspendedCommitReason , // Profiling-only
32913297 completedRenderStartTime : number , // Profiling-only
32923298 completedRenderEndTime : number , // Profiling-only
@@ -3438,6 +3444,7 @@ function commitRoot(
34383444 root ,
34393445 finishedWork ,
34403446 recoverableErrors ,
3447+ suspendedState ,
34413448 enableProfilerTimer
34423449 ? suspendedCommitReason === IMMEDIATE_COMMIT
34433450 ? completedRenderEndTime
@@ -3576,6 +3583,7 @@ function commitRoot(
35763583 pendingEffectsStatus = PENDING_MUTATION_PHASE ;
35773584 if ( enableViewTransition && willStartViewTransition ) {
35783585 pendingViewTransition = startViewTransition (
3586+ suspendedState ,
35793587 root . containerInfo ,
35803588 pendingTransitionTypes ,
35813589 flushMutationEffects ,
@@ -3990,6 +3998,7 @@ function commitGestureOnRoot(
39903998 root : FiberRoot ,
39913999 finishedWork : Fiber ,
39924000 recoverableErrors : null | Array < CapturedValue < mixed >> ,
4001+ suspendedState : null | SuspendedState ,
39934002 renderEndTime : number , // Profiling-only
39944003) : void {
39954004 // We assume that the gesture we just rendered was the first one in the queue.
@@ -4020,6 +4029,7 @@ function commitGestureOnRoot(
40204029 pendingEffectsStatus = PENDING_GESTURE_MUTATION_PHASE ;
40214030
40224031 pendingViewTransition = finishedGesture . running = startGestureTransition (
4032+ suspendedState ,
40234033 root . containerInfo ,
40244034 finishedGesture . provider ,
40254035 finishedGesture . rangeStart ,
0 commit comments