@@ -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 {
@@ -460,11 +462,23 @@ export function requestUpdateLane(fiber: Fiber): Lane {
460462 const currentLanePriority = getCurrentUpdateLanePriority ( ) ;
461463 lane = findUpdateLane ( currentLanePriority , currentEventWipLanes ) ;
462464 } else {
463- const schedulerLanePriority = schedulerPriorityToLanePriority (
464- schedulerPriority ,
465- ) ;
466-
467- lane = findUpdateLane ( schedulerLanePriority , currentEventWipLanes ) ;
465+ if ( enableNativeEventPriorityInference ) {
466+ const eventLanePriority = getCurrentEventPriority ( ) ;
467+ if ( eventLanePriority === DefaultLanePriority ) {
468+ // TODO: move this case into the ReactDOM host config.
469+ const schedulerLanePriority = schedulerPriorityToLanePriority (
470+ schedulerPriority ,
471+ ) ;
472+ lane = findUpdateLane ( schedulerLanePriority , currentEventWipLanes ) ;
473+ } else {
474+ lane = findUpdateLane ( eventLanePriority , currentEventWipLanes ) ;
475+ }
476+ } else {
477+ const schedulerLanePriority = schedulerPriorityToLanePriority (
478+ schedulerPriority ,
479+ ) ;
480+ lane = findUpdateLane ( schedulerLanePriority , currentEventWipLanes ) ;
481+ }
468482 }
469483
470484 return lane ;
0 commit comments