diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 1b334d3fda0a70..4916f8654b5cef 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -34,6 +34,8 @@ const Text: React.AbstractComponent< ellipsizeMode, onLongPress, onPress, + onPressIn, + onPressOut, onResponderGrant, onResponderMove, onResponderRelease, @@ -64,9 +66,15 @@ const Text: React.AbstractComponent< onPress, onPressIn(event) { setHighlighted(!suppressHighlighting); + if (onPressIn) { + onPressIn(event); + } }, onPressOut(event) { setHighlighted(false); + if (onPressOut) { + onPressOut(event); + } }, onResponderTerminationRequest_DEPRECATED: onResponderTerminationRequest, onStartShouldSetResponder_DEPRECATED: onStartShouldSetResponder, @@ -78,6 +86,8 @@ const Text: React.AbstractComponent< pressRetentionOffset, onLongPress, onPress, + onPressIn, + onPressOut, onResponderTerminationRequest, onStartShouldSetResponder, suppressHighlighting, diff --git a/Libraries/Text/TextProps.js b/Libraries/Text/TextProps.js index 9555e576618303..469f14522e3824 100644 --- a/Libraries/Text/TextProps.js +++ b/Libraries/Text/TextProps.js @@ -122,6 +122,8 @@ export type TextProps = $ReadOnly<{| * See https://reactnative.dev/docs/text.html#onpress */ onPress?: ?(event: PressEvent) => mixed, + onPressIn?: ?(event: PressEvent) => mixed, + onPressOut?: ?(event: PressEvent) => mixed, onResponderGrant?: ?(event: PressEvent) => void, onResponderMove?: ?(event: PressEvent) => void, onResponderRelease?: ?(event: PressEvent) => void,