@@ -34,6 +34,7 @@ import {
34
34
disableSchedulerTimeoutInWorkLoop ,
35
35
enableDoubleInvokingEffects ,
36
36
skipUnmountedBoundaries ,
37
+ enableNativeEventPriorityInference ,
37
38
} from 'shared/ReactFeatureFlags' ;
38
39
import ReactSharedInternals from 'shared/ReactSharedInternals' ;
39
40
import invariant from 'shared/invariant' ;
@@ -93,6 +94,7 @@ import {
93
94
afterActiveInstanceBlur ,
94
95
clearContainer ,
95
96
scheduleMicrotask ,
97
+ getCurrentEventPriority ,
96
98
} from './ReactFiberHostConfig' ;
97
99
98
100
import {
@@ -460,11 +462,23 @@ export function requestUpdateLane(fiber: Fiber): Lane {
460
462
const currentLanePriority = getCurrentUpdateLanePriority ( ) ;
461
463
lane = findUpdateLane ( currentLanePriority , currentEventWipLanes ) ;
462
464
} 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
+ }
468
482
}
469
483
470
484
return lane ;
0 commit comments