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
|
* single traversal for the entire collection of events because each event may
|
||||||
* have a different target.
|
* have a different target.
|
||||||
*/
|
*/
|
||||||
function accumulateTwoPhaseDispatchesSingle(event) {
|
export function accumulateTwoPhaseDispatchesSingle(event) {
|
||||||
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
||||||
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
|
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';
|
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 {canUseDOM} from 'shared/ExecutionEnvironment';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -276,7 +276,7 @@ function extractCompositionEvent(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
accumulateTwoPhaseDispatches(event);
|
accumulateTwoPhaseDispatchesSingle(event);
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -437,7 +437,7 @@ function extractBeforeInputEvent(
|
||||||
);
|
);
|
||||||
|
|
||||||
event.data = chars;
|
event.data = chars;
|
||||||
accumulateTwoPhaseDispatches(event);
|
accumulateTwoPhaseDispatchesSingle(event);
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {runEventsInBatch} from 'legacy-events/EventBatching';
|
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 {enqueueStateRestore} from 'legacy-events/ReactControlledComponent';
|
||||||
import {batchedUpdates} from 'legacy-events/ReactGenericBatching';
|
import {batchedUpdates} from 'legacy-events/ReactGenericBatching';
|
||||||
import SyntheticEvent from 'legacy-events/SyntheticEvent';
|
import SyntheticEvent from 'legacy-events/SyntheticEvent';
|
||||||
|
|
@ -59,7 +59,7 @@ function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
|
||||||
event.type = 'change';
|
event.type = 'change';
|
||||||
// Flag this event loop as needing state restore.
|
// Flag this event loop as needing state restore.
|
||||||
enqueueStateRestore(target);
|
enqueueStateRestore(target);
|
||||||
accumulateTwoPhaseDispatches(event);
|
accumulateTwoPhaseDispatchesSingle(event);
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* 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 {canUseDOM} from 'shared/ExecutionEnvironment';
|
||||||
import SyntheticEvent from 'legacy-events/SyntheticEvent';
|
import SyntheticEvent from 'legacy-events/SyntheticEvent';
|
||||||
import isTextInputElement from 'shared/isTextInputElement';
|
import isTextInputElement from 'shared/isTextInputElement';
|
||||||
|
|
@ -135,7 +135,7 @@ function constructSelectEvent(nativeEvent, nativeEventTarget) {
|
||||||
syntheticEvent.type = 'select';
|
syntheticEvent.type = 'select';
|
||||||
syntheticEvent.target = activeElement;
|
syntheticEvent.target = activeElement;
|
||||||
|
|
||||||
accumulateTwoPhaseDispatches(syntheticEvent);
|
accumulateTwoPhaseDispatchesSingle(syntheticEvent);
|
||||||
|
|
||||||
return syntheticEvent;
|
return syntheticEvent;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber';
|
||||||
import type {PluginModule} from 'legacy-events/PluginModuleType';
|
import type {PluginModule} from 'legacy-events/PluginModuleType';
|
||||||
import type {EventSystemFlags} from 'legacy-events/EventSystemFlags';
|
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 SyntheticEvent from 'legacy-events/SyntheticEvent';
|
||||||
|
|
||||||
import * as DOMTopLevelEventTypes from './DOMTopLevelEventTypes';
|
import * as DOMTopLevelEventTypes from './DOMTopLevelEventTypes';
|
||||||
|
|
@ -191,7 +191,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
|
||||||
nativeEvent,
|
nativeEvent,
|
||||||
nativeEventTarget,
|
nativeEventTarget,
|
||||||
);
|
);
|
||||||
accumulateTwoPhaseDispatches(event);
|
accumulateTwoPhaseDispatchesSingle(event);
|
||||||
return event;
|
return event;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user