Skip to content

Commit 26822a5

Browse files
committed
Stash pendingEffectsLanes earlier
In the gap when a commit is delayed, we don't know which lanes are currently pending. We can use the same flag as the ones we use when we're in the middle of commit effects by setting it earlier. This ensures that we don't write an "Animating" track during this period since it'll get some other suspended/delay track logged (for example "waiting on previous animation".
1 parent d703d1c commit 26822a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,7 @@ function finishConcurrentRender(
14381438
// immediately, wait for more data to arrive.
14391439
// TODO: Combine retry throttling with Suspensey commits. Right now they
14401440
// run one after the other.
1441+
pendingEffectsLanes = lanes;
14411442
root.timeoutHandle = scheduleTimeout(
14421443
commitRootWhenReady.bind(
14431444
null,
@@ -1551,6 +1552,7 @@ function commitRootWhenReady(
15511552
// Not yet ready to commit. Delay the commit until the renderer notifies
15521553
// us that it's ready. This will be canceled if we start work on the
15531554
// root again.
1555+
pendingEffectsLanes = lanes;
15541556
root.cancelPendingCommit = schedulePendingCommit(
15551557
commitRoot.bind(
15561558
null,
@@ -2093,6 +2095,8 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
20932095
cancelPendingCommit();
20942096
}
20952097

2098+
pendingEffectsLanes = NoLanes;
2099+
20962100
resetWorkInProgressStack();
20972101
workInProgressRoot = root;
20982102
const rootWorkInProgress = createWorkInProgress(root.current, null);

0 commit comments

Comments
 (0)