@@ -34,6 +34,7 @@ import {
3434 disableSchedulerTimeoutInWorkLoop ,
3535 enableDoubleInvokingEffects ,
3636 skipUnmountedBoundaries ,
37+ enableNativeEventPriorityInference ,
3738} from 'shared/ReactFeatureFlags' ;
3839import ReactSharedInternals from 'shared/ReactSharedInternals' ;
3940import invariant from 'shared/invariant' ;
@@ -93,6 +94,7 @@ import {
9394 afterActiveInstanceBlur ,
9495 clearContainer ,
9596 scheduleMicrotask ,
97+ getCurrentEventPriority ,
9698} from './ReactFiberHostConfig' ;
9799
98100import {
@@ -465,11 +467,23 @@ export function requestUpdateLane(fiber: Fiber): Lane {
465467 const currentLanePriority = getCurrentUpdateLanePriority ( ) ;
466468 lane = findUpdateLane ( currentLanePriority , currentEventWipLanes ) ;
467469 } else {
468- const schedulerLanePriority = schedulerPriorityToLanePriority (
469- schedulerPriority ,
470- ) ;
471-
472- lane = findUpdateLane ( schedulerLanePriority , currentEventWipLanes ) ;
470+ if ( enableNativeEventPriorityInference ) {
471+ const eventLanePriority = getCurrentEventPriority ( ) ;
472+ if ( eventLanePriority === DefaultLanePriority ) {
473+ // TODO: move this case into the ReactDOM host config.
474+ const schedulerLanePriority = schedulerPriorityToLanePriority (
475+ schedulerPriority ,
476+ ) ;
477+ lane = findUpdateLane ( schedulerLanePriority , currentEventWipLanes ) ;
478+ } else {
479+ lane = findUpdateLane ( eventLanePriority , currentEventWipLanes ) ;
480+ }
481+ } else {
482+ const schedulerLanePriority = schedulerPriorityToLanePriority (
483+ schedulerPriority ,
484+ ) ;
485+ lane = findUpdateLane ( schedulerLanePriority , currentEventWipLanes ) ;
486+ }
473487 }
474488
475489 return lane ;
0 commit comments