Skip to content

Commit

Permalink
Text: Remove Extraneous onResponderGrant Argument
Browse files Browse the repository at this point in the history
Summary:
This argument for the `onResponderGrant` event callback on `Text` is extraneous.

Changelog:
[General][Fixed] - Remove extraneous argument for `onResponderGrant` Flow type on `Text`.

Reviewed By: TheSavior

Differential Revision: D23513190

fbshipit-source-id: c4057cf534f4cdf73967e4324db64acc8cf323d0
  • Loading branch information
yungsters authored and facebook-github-bot committed Sep 4, 2020
1 parent fb354cb commit 49015b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions Libraries/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ class TouchableText extends React.Component<Props, State> {
touchableHandleActivePressOut: ?() => void;
touchableHandleLongPress: ?(event: PressEvent) => void;
touchableHandlePress: ?(event: PressEvent) => void;
touchableHandleResponderGrant: ?(
event: PressEvent,
dispatchID: string,
) => void;
touchableHandleResponderGrant: ?(event: PressEvent) => void;
touchableHandleResponderMove: ?(event: PressEvent) => void;
touchableHandleResponderRelease: ?(event: PressEvent) => void;
touchableHandleResponderTerminate: ?(event: PressEvent) => void;
Expand Down Expand Up @@ -179,10 +176,10 @@ class TouchableText extends React.Component<Props, State> {
}
return shouldSetResponder;
},
onResponderGrant: (event: PressEvent, dispatchID: string): void => {
nullthrows(this.touchableHandleResponderGrant)(event, dispatchID);
onResponderGrant: (event: PressEvent): void => {
nullthrows(this.touchableHandleResponderGrant)(event);
if (this.props.onResponderGrant != null) {
this.props.onResponderGrant.call(this, event, dispatchID);
this.props.onResponderGrant.call(this, event);
}
},
onResponderMove: (event: PressEvent): void => {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Text/TextProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export type TextProps = $ReadOnly<{|
* See https://reactnative.dev/docs/text.html#onpress
*/
onPress?: ?(event: PressEvent) => mixed,
onResponderGrant?: ?(event: PressEvent, dispatchID: string) => void,
onResponderGrant?: ?(event: PressEvent) => void,
onResponderMove?: ?(event: PressEvent) => void,
onResponderRelease?: ?(event: PressEvent) => void,
onResponderTerminate?: ?(event: PressEvent) => void,
Expand Down

0 comments on commit 49015b0

Please sign in to comment.