Skip to content

Commit

Permalink
improve flow types
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaGross committed Feb 8, 2022
1 parent bff359e commit 62124f3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/react-native-renderer/src/ReactFabricEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function runExtractedPluginEventsInBatch(

export function dispatchEvent(
target: null | Object,
topLevelType: TopLevelType,
topLevelType: RNTopLevelEventType,
nativeEvent: AnyNativeEvent,
) {
const targetFiber = (target: null | Fiber);
Expand Down Expand Up @@ -111,9 +111,8 @@ export function dispatchEvent(
// to be notified for all events.
// Note that extracted events are *not* emitted,
// only events that have a 1:1 mapping with a native event, at least for now.
const topLevelTypeStr: string = ((topLevelType: any): string);
const event = {eventName: topLevelTypeStr, nativeEvent};
RawEventEmitter.emit(topLevelTypeStr, event);
const event = {eventName: topLevelType, nativeEvent};
RawEventEmitter.emit(topLevelType, event);
RawEventEmitter.emit('*', event);

// Heritage plugin event system
Expand Down

0 comments on commit 62124f3

Please sign in to comment.