Skip to content

Commit

Permalink
Removed Flow generic annotations for createResponder
Browse files Browse the repository at this point in the history
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 .
  • Loading branch information
Brian Vaughn committed Mar 3, 2020
1 parent 24f5ac6 commit 0c34969
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 32 deletions.
9 changes: 5 additions & 4 deletions packages/react-interactions/events/src/dom/ContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 10 additions & 8 deletions packages/react-interactions/events/src/dom/Focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions packages/react-interactions/events/src/dom/Hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions packages/react-interactions/events/src/dom/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions packages/react-interactions/events/src/dom/Keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions packages/react-interactions/events/src/dom/PressLegacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions packages/react-interactions/events/src/dom/Tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0c34969

Please sign in to comment.