Fix regression test

This commit is contained in:
Tianyu Yao
2023-10-12 23:09:51 -07:00
parent 05865c32f5
commit db99db40f4
2 changed files with 9 additions and 3 deletions
@@ -23,6 +23,8 @@ import {
markRootEntangled,
mergeLanes,
claimNextTransitionLane,
includesSomeLane,
UpdateLanes,
} from './ReactFiberLane';
import {
CommitContext,
@@ -232,6 +234,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy: boolean) {
root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes,
);
if (includesSyncLane(nextLanes)) {
// Avoid triggering the warning on selective hydartion
if (!includesSomeLane(nextLanes, UpdateLanes)) {
nestedUpdatePasses = 0;
}
// This root has pending sync work. Flush it now.
try {
didPerformSomeWork = true;
+3 -3
View File
@@ -3010,9 +3010,9 @@ function commitRootImpl(
// those scenarios otherwise. This won't catch recursive async updates,
// though, which is why we check the flags above first.
// Was the finished render the result of an update (not hydration)?
includesSomeLane(lanes, UpdateLanes) &&
// Did it schedule a sync update?
includesSomeLane(remainingLanes, SyncUpdateLanes)
(includesSomeLane(lanes, UpdateLanes) &&
// Did it schedule a sync update?
includesSomeLane(remainingLanes, SyncUpdateLanes))
) {
if (enableProfilerTimer && enableProfilerNestedUpdatePhase) {
markNestedUpdateScheduled();