Skip to content

Commit db99db4

Browse files
committed
Fix regression test
1 parent 05865c3 commit db99db4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/react-reconciler/src/ReactFiberRootScheduler.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import {
2323
markRootEntangled,
2424
mergeLanes,
2525
claimNextTransitionLane,
26+
includesSomeLane,
27+
UpdateLanes,
2628
} from './ReactFiberLane';
2729
import {
2830
CommitContext,
@@ -232,6 +234,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy: boolean) {
232234
root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes,
233235
);
234236
if (includesSyncLane(nextLanes)) {
237+
// Avoid triggering the warning on selective hydartion
238+
if (!includesSomeLane(nextLanes, UpdateLanes)) {
239+
nestedUpdatePasses = 0;
240+
}
235241
// This root has pending sync work. Flush it now.
236242
try {
237243
didPerformSomeWork = true;

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,9 +3010,9 @@ function commitRootImpl(
30103010
// those scenarios otherwise. This won't catch recursive async updates,
30113011
// though, which is why we check the flags above first.
30123012
// Was the finished render the result of an update (not hydration)?
3013-
includesSomeLane(lanes, UpdateLanes) &&
3014-
// Did it schedule a sync update?
3015-
includesSomeLane(remainingLanes, SyncUpdateLanes)
3013+
(includesSomeLane(lanes, UpdateLanes) &&
3014+
// Did it schedule a sync update?
3015+
includesSomeLane(remainingLanes, SyncUpdateLanes))
30163016
) {
30173017
if (enableProfilerTimer && enableProfilerNestedUpdatePhase) {
30183018
markNestedUpdateScheduled();

0 commit comments

Comments
 (0)