diff --git a/packages/react-reconciler/src/ReactFiberCompleteWork.new.js b/packages/react-reconciler/src/ReactFiberCompleteWork.new.js index e85af7d9f5dba..858f8e76fb75c 100644 --- a/packages/react-reconciler/src/ReactFiberCompleteWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCompleteWork.new.js @@ -1191,6 +1191,15 @@ function completeWork( } } + // If the suspended state of the boundary changes, we need to schedule + // a passive effect, which is when we process the transitions + if (nextDidTimeout !== prevDidTimeout) { + if (enableTransitionTracing) { + const offscreenFiber: Fiber = (workInProgress.child: any); + offscreenFiber.flags |= Passive; + } + } + // If the suspended state of the boundary changes, we need to schedule // an effect to toggle the subtree's visibility. When we switch from // fallback -> primary, the inner Offscreen fiber schedules this effect @@ -1206,12 +1215,6 @@ function completeWork( const offscreenFiber: Fiber = (workInProgress.child: any); offscreenFiber.flags |= Visibility; - // If the suspended state of the boundary changes, we need to schedule - // a passive effect, which is when we process the transitions - if (enableTransitionTracing) { - offscreenFiber.flags |= Passive; - } - // TODO: This will still suspend a synchronous tree if anything // in the concurrent tree already suspended during this render. // This is a known bug.