From 65718084e26e4a8dacc580a4cbfdbf699b21d6b2 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Tue, 1 Oct 2019 15:29:43 -0700 Subject: [PATCH] Move eventSystemFlags to last argument in event plugin extractors --- packages/legacy-events/EventPluginHub.js | 8 ++++---- packages/legacy-events/PluginModuleType.js | 2 +- packages/legacy-events/ResponderEventPlugin.js | 2 +- .../__tests__/ResponderEventPlugin-test.internal.js | 2 +- .../react-devtools-shell/src/app/ReactNativeWeb/index.js | 4 ++-- packages/react-dom/src/events/BeforeInputEventPlugin.js | 2 +- packages/react-dom/src/events/ChangeEventPlugin.js | 2 +- packages/react-dom/src/events/EnterLeaveEventPlugin.js | 2 +- packages/react-dom/src/events/ReactDOMEventListener.js | 2 +- packages/react-dom/src/events/SelectEventPlugin.js | 2 +- packages/react-dom/src/events/SimpleEventPlugin.js | 2 +- .../react-native-renderer/src/ReactFabricEventEmitter.js | 2 +- .../src/ReactNativeBridgeEventPlugin.js | 2 +- .../react-native-renderer/src/ReactNativeEventEmitter.js | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/legacy-events/EventPluginHub.js b/packages/legacy-events/EventPluginHub.js index 1ab4bc3fa4561..f5068ff39b18e 100644 --- a/packages/legacy-events/EventPluginHub.js +++ b/packages/legacy-events/EventPluginHub.js @@ -132,10 +132,10 @@ export function getListener(inst: Fiber, registrationName: string) { */ function extractPluginEvents( topLevelType: TopLevelType, - eventSystemFlags: EventSystemFlags, targetInst: null | Fiber, nativeEvent: AnyNativeEvent, nativeEventTarget: EventTarget, + eventSystemFlags: EventSystemFlags, ): Array | ReactSyntheticEvent | null { let events = null; for (let i = 0; i < plugins.length; i++) { @@ -144,10 +144,10 @@ function extractPluginEvents( if (possiblePlugin) { const extractedEvents = possiblePlugin.extractEvents( topLevelType, - eventSystemFlags, targetInst, nativeEvent, nativeEventTarget, + eventSystemFlags, ); if (extractedEvents) { events = accumulateInto(events, extractedEvents); @@ -159,17 +159,17 @@ function extractPluginEvents( export function runExtractedPluginEventsInBatch( topLevelType: TopLevelType, - eventSystemFlags: EventSystemFlags, targetInst: null | Fiber, nativeEvent: AnyNativeEvent, nativeEventTarget: EventTarget, + eventSystemFlags: EventSystemFlags, ) { const events = extractPluginEvents( topLevelType, - eventSystemFlags, targetInst, nativeEvent, nativeEventTarget, + eventSystemFlags, ); runEventsInBatch(events); } diff --git a/packages/legacy-events/PluginModuleType.js b/packages/legacy-events/PluginModuleType.js index c1cf5fc6783e8..d6728427e874f 100644 --- a/packages/legacy-events/PluginModuleType.js +++ b/packages/legacy-events/PluginModuleType.js @@ -25,10 +25,10 @@ export type PluginModule = { eventTypes: EventTypes, extractEvents: ( topLevelType: TopLevelType, - eventSystemFlags: EventSystemFlags, targetInst: null | Fiber, nativeTarget: NativeEvent, nativeEventTarget: EventTarget, + eventSystemFlags: EventSystemFlags, ) => ?ReactSyntheticEvent, tapMoveThreshold?: number, }; diff --git a/packages/legacy-events/ResponderEventPlugin.js b/packages/legacy-events/ResponderEventPlugin.js index aea49578a397f..f58323aa9a8bb 100644 --- a/packages/legacy-events/ResponderEventPlugin.js +++ b/packages/legacy-events/ResponderEventPlugin.js @@ -504,10 +504,10 @@ const ResponderEventPlugin = { */ extractEvents: function( topLevelType, - eventSystemFlags, targetInst, nativeEvent, nativeEventTarget, + eventSystemFlags, ) { if (isStartish(topLevelType)) { trackedTouchCount += 1; diff --git a/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js b/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js index c235578b28758..abe96a3808057 100644 --- a/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js +++ b/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js @@ -314,10 +314,10 @@ const run = function(config, hierarchyConfig, nativeEventConfig) { // Trigger the event const extractedEvents = ResponderEventPlugin.extractEvents( nativeEventConfig.topLevelType, - PLUGIN_EVENT_SYSTEM, nativeEventConfig.targetInst, nativeEventConfig.nativeEvent, nativeEventConfig.target, + PLUGIN_EVENT_SYSTEM, ); // At this point the negotiation events have been dispatched as part of the diff --git a/packages/react-devtools-shell/src/app/ReactNativeWeb/index.js b/packages/react-devtools-shell/src/app/ReactNativeWeb/index.js index 9f8246458e7b9..95961378f00d2 100644 --- a/packages/react-devtools-shell/src/app/ReactNativeWeb/index.js +++ b/packages/react-devtools-shell/src/app/ReactNativeWeb/index.js @@ -11,7 +11,7 @@ import React, {Fragment, useState} from 'react'; import {Button, Text, View} from 'react-native-web'; export default function ReactNativeWeb() { - const [backgroundColor, setBackgroundColor] = useState('blue'); + const [backgroundColor, setBackgroundColor] = useState('purple'); const toggleColor = () => setBackgroundColor(backgroundColor === 'purple' ? 'green' : 'purple'); return ( @@ -29,8 +29,8 @@ export default function ReactNativeWeb() { left