Skip to content

Commit 2fe0fbb

Browse files
authored
Use accumulateTwoPhaseDispatchesSingle directly (#18203)
1 parent 503fd82 commit 2fe0fbb

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

packages/legacy-events/EventPropagators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function accumulateDirectionalDispatches(inst, phase, event) {
6666
* single traversal for the entire collection of events because each event may
6767
* have a different target.
6868
*/
69-
function accumulateTwoPhaseDispatchesSingle(event) {
69+
export function accumulateTwoPhaseDispatchesSingle(event) {
7070
if (event && event.dispatchConfig.phasedRegistrationNames) {
7171
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
7272
}

packages/react-dom/src/events/BeforeInputEventPlugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';
99

10-
import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
10+
import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
1111
import {canUseDOM} from 'shared/ExecutionEnvironment';
1212

1313
import {
@@ -276,7 +276,7 @@ function extractCompositionEvent(
276276
}
277277
}
278278

279-
accumulateTwoPhaseDispatches(event);
279+
accumulateTwoPhaseDispatchesSingle(event);
280280
return event;
281281
}
282282

@@ -437,7 +437,7 @@ function extractBeforeInputEvent(
437437
);
438438

439439
event.data = chars;
440-
accumulateTwoPhaseDispatches(event);
440+
accumulateTwoPhaseDispatchesSingle(event);
441441
return event;
442442
}
443443

packages/react-dom/src/events/ChangeEventPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import {runEventsInBatch} from 'legacy-events/EventBatching';
9-
import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
9+
import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
1010
import {enqueueStateRestore} from 'legacy-events/ReactControlledComponent';
1111
import {batchedUpdates} from 'legacy-events/ReactGenericBatching';
1212
import SyntheticEvent from 'legacy-events/SyntheticEvent';
@@ -59,7 +59,7 @@ function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
5959
event.type = 'change';
6060
// Flag this event loop as needing state restore.
6161
enqueueStateRestore(target);
62-
accumulateTwoPhaseDispatches(event);
62+
accumulateTwoPhaseDispatchesSingle(event);
6363
return event;
6464
}
6565
/**

packages/react-dom/src/events/SelectEventPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
8+
import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
99
import {canUseDOM} from 'shared/ExecutionEnvironment';
1010
import SyntheticEvent from 'legacy-events/SyntheticEvent';
1111
import isTextInputElement from 'shared/isTextInputElement';
@@ -135,7 +135,7 @@ function constructSelectEvent(nativeEvent, nativeEventTarget) {
135135
syntheticEvent.type = 'select';
136136
syntheticEvent.target = activeElement;
137137

138-
accumulateTwoPhaseDispatches(syntheticEvent);
138+
accumulateTwoPhaseDispatchesSingle(syntheticEvent);
139139

140140
return syntheticEvent;
141141
}

packages/react-dom/src/events/SimpleEventPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber';
1616
import type {PluginModule} from 'legacy-events/PluginModuleType';
1717
import type {EventSystemFlags} from 'legacy-events/EventSystemFlags';
1818

19-
import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators';
19+
import {accumulateTwoPhaseDispatchesSingle} from 'legacy-events/EventPropagators';
2020
import SyntheticEvent from 'legacy-events/SyntheticEvent';
2121

2222
import * as DOMTopLevelEventTypes from './DOMTopLevelEventTypes';
@@ -191,7 +191,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
191191
nativeEvent,
192192
nativeEventTarget,
193193
);
194-
accumulateTwoPhaseDispatches(event);
194+
accumulateTwoPhaseDispatchesSingle(event);
195195
return event;
196196
},
197197
};

0 commit comments

Comments
 (0)