Commit d745597 1 parent f04bcb8 commit d745597 Copy full SHA for d745597
File tree 2 files changed +42
-0
lines changed
packages/react-reconciler/src
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -598,6 +598,27 @@ export function scheduleUpdateOnFiber(
598
598
flushSyncCallbackQueue ( ) ;
599
599
}
600
600
}
601
+ } else if ( decoupleUpdatePriorityFromScheduler ) {
602
+ const updateLanePriority = getCurrentUpdateLanePriority ( ) ;
603
+
604
+ // Schedule a discrete update but only if it's not Sync.
605
+ if (
606
+ ( executionContext & DiscreteEventContext ) !== NoContext &&
607
+ // Only updates at user-blocking priority or greater are considered
608
+ // discrete, even inside a discrete event.
609
+ updateLanePriority === InputDiscreteLanePriority
610
+ ) {
611
+ // This is the result of a discrete event. Track the lowest priority
612
+ // discrete update per root so we can flush them early, if needed.
613
+ if ( rootsWithPendingDiscreteUpdates === null ) {
614
+ rootsWithPendingDiscreteUpdates = new Set ( [ root ] ) ;
615
+ } else {
616
+ rootsWithPendingDiscreteUpdates . add ( root ) ;
617
+ }
618
+ }
619
+ // Schedule other updates after in case the callback is sync.
620
+ ensureRootIsScheduled ( root , eventTime ) ;
621
+ schedulePendingInteractions ( root , lane ) ;
601
622
} else {
602
623
// Schedule a discrete update but only if it's not Sync.
603
624
if (
Original file line number Diff line number Diff line change @@ -598,6 +598,27 @@ export function scheduleUpdateOnFiber(
598
598
flushSyncCallbackQueue ( ) ;
599
599
}
600
600
}
601
+ } else if ( decoupleUpdatePriorityFromScheduler ) {
602
+ const updateLanePriority = getCurrentUpdateLanePriority ( ) ;
603
+
604
+ // Schedule a discrete update but only if it's not Sync.
605
+ if (
606
+ ( executionContext & DiscreteEventContext ) !== NoContext &&
607
+ // Only updates at user-blocking priority or greater are considered
608
+ // discrete, even inside a discrete event.
609
+ updateLanePriority === InputDiscreteLanePriority
610
+ ) {
611
+ // This is the result of a discrete event. Track the lowest priority
612
+ // discrete update per root so we can flush them early, if needed.
613
+ if ( rootsWithPendingDiscreteUpdates === null ) {
614
+ rootsWithPendingDiscreteUpdates = new Set ( [ root ] ) ;
615
+ } else {
616
+ rootsWithPendingDiscreteUpdates . add ( root ) ;
617
+ }
618
+ }
619
+ // Schedule other updates after in case the callback is sync.
620
+ ensureRootIsScheduled ( root , eventTime ) ;
621
+ schedulePendingInteractions ( root , lane ) ;
601
622
} else {
602
623
// Schedule a discrete update but only if it's not Sync.
603
624
if (
You can’t perform that action at this time.
0 commit comments