Skip to content

Commit

Permalink
Use accumulateTwoPhaseDispatchesSingle directly (#18203)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Mar 5, 2020
1 parent 503fd82 commit 2fe0fbb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/legacy-events/EventPropagators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/react-dom/src/events/BeforeInputEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -276,7 +276,7 @@ function extractCompositionEvent(
}
}

accumulateTwoPhaseDispatches(event);
accumulateTwoPhaseDispatchesSingle(event);
return event;
}

Expand Down Expand Up @@ -437,7 +437,7 @@ function extractBeforeInputEvent(
);

event.data = chars;
accumulateTwoPhaseDispatches(event);
accumulateTwoPhaseDispatchesSingle(event);
return event;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/ChangeEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
}
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/SelectEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -135,7 +135,7 @@ function constructSelectEvent(nativeEvent, nativeEventTarget) {
syntheticEvent.type = 'select';
syntheticEvent.target = activeElement;

accumulateTwoPhaseDispatches(syntheticEvent);
accumulateTwoPhaseDispatchesSingle(syntheticEvent);

return syntheticEvent;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/SimpleEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -191,7 +191,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
nativeEvent,
nativeEventTarget,
);
accumulateTwoPhaseDispatches(event);
accumulateTwoPhaseDispatchesSingle(event);
return event;
},
};
Expand Down

0 comments on commit 2fe0fbb

Please sign in to comment.