From 0c34969c3359b7220084d36fcfc04feaf3d1557c Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 3 Mar 2020 11:19:38 -0800 Subject: [PATCH] Removed Flow generic annotations for createResponder This seems to cause a parsing error. (Not sure why.) The API is deprecated anyway so I'm being lazy for now and just adding a . --- .../events/src/dom/ContextMenu.js | 9 +++++---- .../react-interactions/events/src/dom/Focus.js | 18 ++++++++++-------- .../react-interactions/events/src/dom/Hover.js | 9 +++++---- .../react-interactions/events/src/dom/Input.js | 9 +++++---- .../events/src/dom/Keyboard.js | 9 +++++---- .../events/src/dom/PressLegacy.js | 9 +++++---- .../react-interactions/events/src/dom/Tap.js | 9 +++++---- 7 files changed, 40 insertions(+), 32 deletions(-) diff --git a/packages/react-interactions/events/src/dom/ContextMenu.js b/packages/react-interactions/events/src/dom/ContextMenu.js index 9268c354c8dc2..8cccb992d4075 100644 --- a/packages/react-interactions/events/src/dom/ContextMenu.js +++ b/packages/react-interactions/events/src/dom/ContextMenu.js @@ -113,10 +113,11 @@ const contextMenuImpl = { }, }; -export const ContextMenuResponder = React.DEPRECATED_createResponder< - ReactDOMResponderEvent, - ReactDOMResponderContext, ->('ContextMenu', contextMenuImpl); +// $FlowFixMe Can't add generic types without causing a parsing/syntax errors +export const ContextMenuResponder = React.DEPRECATED_createResponder( + 'ContextMenu', + contextMenuImpl, +); export function useContextMenu( props: ContextMenuProps, diff --git a/packages/react-interactions/events/src/dom/Focus.js b/packages/react-interactions/events/src/dom/Focus.js index 57719e8d69cec..17a9b72d6bc89 100644 --- a/packages/react-interactions/events/src/dom/Focus.js +++ b/packages/react-interactions/events/src/dom/Focus.js @@ -494,10 +494,11 @@ const focusResponderImpl = { }, }; -export const FocusResponder = React.DEPRECATED_createResponder< - ReactDOMResponderEvent, - ReactDOMResponderContext, ->('Focus', focusResponderImpl); +// $FlowFixMe Can't add generic types without causing a parsing/syntax errors +export const FocusResponder = React.DEPRECATED_createResponder( + 'Focus', + focusResponderImpl, +); export function useFocus( props: FocusProps, @@ -680,10 +681,11 @@ const focusWithinResponderImpl = { }, }; -export const FocusWithinResponder = React.DEPRECATED_createResponder< - ReactDOMResponderEvent, - ReactDOMResponderContext, ->('FocusWithin', focusWithinResponderImpl); +// $FlowFixMe Can't add generic types without causing a parsing/syntax errors +export const FocusWithinResponder = React.DEPRECATED_createResponder( + 'FocusWithin', + focusWithinResponderImpl, +); export function useFocusWithin( props: FocusWithinProps, diff --git a/packages/react-interactions/events/src/dom/Hover.js b/packages/react-interactions/events/src/dom/Hover.js index 8613f25983e4f..c7db1d1bb7754 100644 --- a/packages/react-interactions/events/src/dom/Hover.js +++ b/packages/react-interactions/events/src/dom/Hover.js @@ -378,10 +378,11 @@ const hoverResponderFallbackImpl = { onUnmount: unmountResponder, }; -export const HoverResponder = React.DEPRECATED_createResponder< - ReactDOMResponderEvent, - ReactDOMResponderContext, ->('Hover', hasPointerEvents ? hoverResponderImpl : hoverResponderFallbackImpl); +// $FlowFixMe Can't add generic types without causing a parsing/syntax errors +export const HoverResponder = React.DEPRECATED_createResponder( + 'Hover', + hasPointerEvents ? hoverResponderImpl : hoverResponderFallbackImpl, +); export function useHover( props: HoverProps, diff --git a/packages/react-interactions/events/src/dom/Input.js b/packages/react-interactions/events/src/dom/Input.js index 30d35d88bf0b5..dbe0e98dae927 100644 --- a/packages/react-interactions/events/src/dom/Input.js +++ b/packages/react-interactions/events/src/dom/Input.js @@ -212,10 +212,11 @@ const inputResponderImpl = { }, }; -export const InputResponder = React.DEPRECATED_createResponder< - ReactDOMResponderEvent, - ReactDOMResponderContext, ->('Input', inputResponderImpl); +// $FlowFixMe Can't add generic types without causing a parsing/syntax errors +export const InputResponder = React.DEPRECATED_createResponder( + 'Input', + inputResponderImpl, +); export function useInput( props: InputResponderProps, diff --git a/packages/react-interactions/events/src/dom/Keyboard.js b/packages/react-interactions/events/src/dom/Keyboard.js index 2d2c947f29f8c..4e8a23ded61ab 100644 --- a/packages/react-interactions/events/src/dom/Keyboard.js +++ b/packages/react-interactions/events/src/dom/Keyboard.js @@ -229,10 +229,11 @@ const keyboardResponderImpl = { }, }; -export const KeyboardResponder = React.DEPRECATED_createResponder< - ReactDOMResponderEvent, - ReactDOMResponderContext, ->('Keyboard', keyboardResponderImpl); +// $FlowFixMe Can't add generic types without causing a parsing/syntax errors +export const KeyboardResponder = React.DEPRECATED_createResponder( + 'Keyboard', + keyboardResponderImpl, +); export function useKeyboard( props: KeyboardProps, diff --git a/packages/react-interactions/events/src/dom/PressLegacy.js b/packages/react-interactions/events/src/dom/PressLegacy.js index 8f0c27fff02f6..d869eace7535b 100644 --- a/packages/react-interactions/events/src/dom/PressLegacy.js +++ b/packages/react-interactions/events/src/dom/PressLegacy.js @@ -903,10 +903,11 @@ const pressResponderImpl = { }, }; -export const PressResponder = React.DEPRECATED_createResponder< - ReactDOMResponderEvent, - ReactDOMResponderContext, ->('Press', pressResponderImpl); +// $FlowFixMe Can't add generic types without causing a parsing/syntax errors +export const PressResponder = React.DEPRECATED_createResponder( + 'Press', + pressResponderImpl, +); export function usePress( props: PressProps, diff --git a/packages/react-interactions/events/src/dom/Tap.js b/packages/react-interactions/events/src/dom/Tap.js index 28cf806f88343..e633a71cbd0c5 100644 --- a/packages/react-interactions/events/src/dom/Tap.js +++ b/packages/react-interactions/events/src/dom/Tap.js @@ -721,10 +721,11 @@ const responderImpl = { }, }; -export const TapResponder = React.DEPRECATED_createResponder< - ReactDOMResponderEvent, - ReactDOMResponderContext, ->('Tap', responderImpl); +// $FlowFixMe Can't add generic types without causing a parsing/syntax errors +export const TapResponder = React.DEPRECATED_createResponder( + 'Tap', + responderImpl, +); export function useTap( props: TapProps,