@@ -39,9 +39,10 @@ import {
39
39
enableCache ,
40
40
enableSchedulingProfiler ,
41
41
enableUpdaterTracking ,
42
- enableSyncDefaultUpdates ,
42
+ allowConcurrentByDefault ,
43
43
} from 'shared/ReactFeatureFlags' ;
44
44
import { isDevToolsPresent } from './ReactFiberDevToolsHook.new' ;
45
+ import { ConcurrentUpdatesByDefaultMode , NoMode } from './ReactTypeOfMode' ;
45
46
46
47
export const SyncLanePriority : LanePriority = 12 ;
47
48
@@ -318,11 +319,12 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
318
319
}
319
320
320
321
if (
321
- // TODO: Check for root override, once that lands
322
- enableSyncDefaultUpdates &&
323
- ( nextLanes & InputContinuousLane ) !== NoLanes
322
+ allowConcurrentByDefault &&
323
+ ( root . current . mode & ConcurrentUpdatesByDefaultMode ) !== NoMode
324
324
) {
325
- // When updates are sync by default, we entangle continous priority updates
325
+ // Do nothing, use the lanes as they were assigned.
326
+ } else if ( ( nextLanes & InputContinuousLane ) !== NoLanes ) {
327
+ // When updates are sync by default, we entangle continuous priority updates
326
328
// and default updates, so they render in the same batch. The only reason
327
329
// they use separate lanes is because continuous updates should interrupt
328
330
// transitions, but default updates should not.
@@ -527,17 +529,21 @@ export function shouldTimeSlice(root: FiberRoot, lanes: Lanes) {
527
529
// finish rendering without yielding execution.
528
530
return false ;
529
531
}
530
- if ( enableSyncDefaultUpdates ) {
531
- const SyncDefaultLanes =
532
- InputContinuousHydrationLane |
533
- InputContinuousLane |
534
- DefaultHydrationLane |
535
- DefaultLane ;
536
- // TODO: Check for root override, once that lands
537
- return ( lanes & SyncDefaultLanes ) === NoLanes ;
538
- } else {
532
+
533
+ if (
534
+ allowConcurrentByDefault &&
535
+ ( root . current . mode & ConcurrentUpdatesByDefaultMode ) !== NoMode
536
+ ) {
537
+ // Concurrent updates by default always use time slicing.
539
538
return true ;
540
539
}
540
+
541
+ const SyncDefaultLanes =
542
+ InputContinuousHydrationLane |
543
+ InputContinuousLane |
544
+ DefaultHydrationLane |
545
+ DefaultLane ;
546
+ return ( lanes & SyncDefaultLanes ) === NoLanes ;
541
547
}
542
548
543
549
export function isTransitionLane ( lane : Lane ) {
0 commit comments