mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix regression test
This commit is contained in:
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user