@@ -39,9 +39,10 @@ import {
3939 enableCache ,
4040 enableSchedulingProfiler ,
4141 enableUpdaterTracking ,
42- enableSyncDefaultUpdates ,
42+ allowConcurrentByDefault ,
4343} from 'shared/ReactFeatureFlags' ;
4444import { isDevToolsPresent } from './ReactFiberDevToolsHook.new' ;
45+ import { ConcurrentUpdatesByDefaultMode , NoMode } from './ReactTypeOfMode' ;
4546
4647export const SyncLanePriority : LanePriority = 12 ;
4748
@@ -318,11 +319,12 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
318319 }
319320
320321 if (
321- // TODO: Check for root override, once that lands
322- enableSyncDefaultUpdates &&
323- ( nextLanes & InputContinuousLane ) !== NoLanes
322+ allowConcurrentByDefault &&
323+ ( root . current . mode & ConcurrentUpdatesByDefaultMode ) !== NoMode
324324 ) {
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
326328 // and default updates, so they render in the same batch. The only reason
327329 // they use separate lanes is because continuous updates should interrupt
328330 // transitions, but default updates should not.
@@ -527,17 +529,21 @@ export function shouldTimeSlice(root: FiberRoot, lanes: Lanes) {
527529 // finish rendering without yielding execution.
528530 return false ;
529531 }
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.
539538 return true ;
540539 }
540+
541+ const SyncDefaultLanes =
542+ InputContinuousHydrationLane |
543+ InputContinuousLane |
544+ DefaultHydrationLane |
545+ DefaultLane ;
546+ return ( lanes & SyncDefaultLanes ) === NoLanes ;
541547}
542548
543549export function isTransitionLane ( lane : Lane ) {
0 commit comments