Skip to content

Commit 3525516

Browse files
committed
move passive flag
1 parent 0568c0f commit 3525516

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/react-reconciler/src/ReactFiberCompleteWork.new.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,15 @@ function completeWork(
11911191
}
11921192
}
11931193

1194+
// If the suspended state of the boundary changes, we need to schedule
1195+
// a passive effect, which is when we process the transitions
1196+
if (nextDidTimeout !== prevDidTimeout) {
1197+
if (enableTransitionTracing) {
1198+
const offscreenFiber: Fiber = (workInProgress.child: any);
1199+
offscreenFiber.flags |= Passive;
1200+
}
1201+
}
1202+
11941203
// If the suspended state of the boundary changes, we need to schedule
11951204
// an effect to toggle the subtree's visibility. When we switch from
11961205
// fallback -> primary, the inner Offscreen fiber schedules this effect
@@ -1206,12 +1215,6 @@ function completeWork(
12061215
const offscreenFiber: Fiber = (workInProgress.child: any);
12071216
offscreenFiber.flags |= Visibility;
12081217

1209-
// If the suspended state of the boundary changes, we need to schedule
1210-
// a passive effect, which is when we process the transitions
1211-
if (enableTransitionTracing) {
1212-
offscreenFiber.flags |= Passive;
1213-
}
1214-
12151218
// TODO: This will still suspend a synchronous tree if anything
12161219
// in the concurrent tree already suspended during this render.
12171220
// This is a known bug.

0 commit comments

Comments
 (0)