mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Use accumulateTwoPhaseDispatchesSingle directly (#18203)
This commit is contained in:
parent
503fd82b42
commit
2fe0fbb05e
|
|
@ -66,7 +66,7 @@ function accumulateDirectionalDispatches(inst, phase, event) {
|
|||
* single traversal for the entire collection of events because each event may
|
||||
* have a different target.
|
||||
*/
|
||||
function accumulateTwoPhaseDispatchesSingle(event) {
|
||||
export function accumulateTwoPhaseDispatchesSingle(event) {
|
||||
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
||||
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';
|
||||
|
||||
import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
|
||||
import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
|
||||
import {canUseDOM} from 'shared/ExecutionEnvironment';
|
||||
|
||||
import {
|
||||
|
|
@ -276,7 +276,7 @@ function extractCompositionEvent(
|
|||
}
|
||||
}
|
||||
|
||||
accumulateTwoPhaseDispatches(event);
|
||||
accumulateTwoPhaseDispatchesSingle(event);
|
||||
return event;
|
||||
}
|
||||
|
||||
|
|
@ -437,7 +437,7 @@ function extractBeforeInputEvent(
|
|||
);
|
||||
|
||||
event.data = chars;
|
||||
accumulateTwoPhaseDispatches(event);
|
||||
accumulateTwoPhaseDispatchesSingle(event);
|
||||
return event;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import {runEventsInBatch} from 'legacy-events/EventBatching';
|
||||
import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
|
||||
import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
|
||||
import {enqueueStateRestore} from 'legacy-events/ReactControlledComponent';
|
||||
import {batchedUpdates} from 'legacy-events/ReactGenericBatching';
|
||||
import SyntheticEvent from 'legacy-events/SyntheticEvent';
|
||||
|
|
@ -59,7 +59,7 @@ function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
|
|||
event.type = 'change';
|
||||
// Flag this event loop as needing state restore.
|
||||
enqueueStateRestore(target);
|
||||
accumulateTwoPhaseDispatches(event);
|
||||
accumulateTwoPhaseDispatchesSingle(event);
|
||||
return event;
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
|
||||
import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
|
||||
import {canUseDOM} from 'shared/ExecutionEnvironment';
|
||||
import SyntheticEvent from 'legacy-events/SyntheticEvent';
|
||||
import isTextInputElement from 'shared/isTextInputElement';
|
||||
|
|
@ -135,7 +135,7 @@ function constructSelectEvent(nativeEvent, nativeEventTarget) {
|
|||
syntheticEvent.type = 'select';
|
||||
syntheticEvent.target = activeElement;
|
||||
|
||||
accumulateTwoPhaseDispatches(syntheticEvent);
|
||||
accumulateTwoPhaseDispatchesSingle(syntheticEvent);
|
||||
|
||||
return syntheticEvent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber';
|
|||
import type {PluginModule} from 'legacy-events/PluginModuleType';
|
||||
import type {EventSystemFlags} from 'legacy-events/EventSystemFlags';
|
||||
|
||||
import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
|
||||
import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
|
||||
import SyntheticEvent from 'legacy-events/SyntheticEvent';
|
||||
|
||||
import * as DOMTopLevelEventTypes from './DOMTopLevelEventTypes';
|
||||
|
|
@ -191,7 +191,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
|
|||
nativeEvent,
|
||||
nativeEventTarget,
|
||||
);
|
||||
accumulateTwoPhaseDispatches(event);
|
||||
accumulateTwoPhaseDispatchesSingle(event);
|
||||
return event;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user