Use accumulateTwoPhaseDispatchesSingle directly (#18203)

This commit is contained in:
Dominic Gannaway 2020-03-05 00:04:27 +00:00 committed by GitHub
parent 503fd82b42
commit 2fe0fbb05e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 10 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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;
},
};