From 49015b0f5bda83794b88b17dd3cbd834fa235b72 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Fri, 4 Sep 2020 16:09:02 -0700 Subject: [PATCH] Text: Remove Extraneous `onResponderGrant` Argument 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 --- Libraries/Text/Text.js | 11 ++++------- Libraries/Text/TextProps.js | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 6ff8c14c267d92..cce9cb3d9547e0 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -98,10 +98,7 @@ class TouchableText extends React.Component { 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; @@ -179,10 +176,10 @@ class TouchableText extends React.Component { } 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 => { diff --git a/Libraries/Text/TextProps.js b/Libraries/Text/TextProps.js index 4b48bc57066a4d..9555e576618303 100644 --- a/Libraries/Text/TextProps.js +++ b/Libraries/Text/TextProps.js @@ -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,