From d0668450aadb0f0201fc623a4fc64c74c02fa3a3 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Sat, 23 May 2026 06:15:58 -0700 Subject: [PATCH] Add pointerEvents prop to TextProps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Add `pointerEvents` to `TextProps` in the Flow source. This prop is supported at the native layer — `BaseParagraphProps` (the C++ props struct for Text/Paragraph) extends `ViewProps`, which includes `pointerEvents`. The old hand-written TypeScript types (`Text.d.ts`) already declared this prop, but the Flow source did not, causing a gap in the auto-generated strict API types (`types_generated`). Changelog: [General][Fixed] - **Strict TypeScript API**: Add missing `pointerEvents` prop to `Text` component Differential Revision: D106183960 --- packages/react-native/Libraries/Text/TextProps.js | 7 +++++++ packages/react-native/ReactNativeApi.d.ts | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/react-native/Libraries/Text/TextProps.js b/packages/react-native/Libraries/Text/TextProps.js index d6be6a5658cb..52925d611077 100644 --- a/packages/react-native/Libraries/Text/TextProps.js +++ b/packages/react-native/Libraries/Text/TextProps.js @@ -124,6 +124,13 @@ export type TextPropsAndroid = { type TextBaseProps = Readonly<{ onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown, + /** + * Controls whether the `Text` can be the target of touch events. + * + * See https://reactnative.dev/docs/view#pointerevents + */ + pointerEvents?: ?('auto' | 'box-none' | 'box-only' | 'none'), + /** * Whether fonts should scale to respect Text Size accessibility settings. * The default is `true`. diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index abd52ddb4370..8a67e7a97a28 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<08dd369849273136812ea5edbda6e1df>> + * @generated SignedSource<<74de6847fd6b214f286780939f9c039f>> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -5092,6 +5092,7 @@ declare type TextBaseProps = { readonly onResponderTerminationRequest?: () => boolean readonly onStartShouldSetResponder?: () => boolean readonly onTextLayout?: (event: TextLayoutEvent) => unknown + readonly pointerEvents?: "auto" | "box-none" | "box-only" | "none" readonly pressRetentionOffset?: PressRetentionOffset readonly role?: Role readonly selectable?: boolean @@ -6007,7 +6008,7 @@ export { AlertOptions, // a0cdac0f AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // 1a47480c + Animated, // fec47bfa AppConfig, // ce4209a7 AppRegistry, // 5edf0524 AppState, // 12012be5 @@ -6227,7 +6228,7 @@ export { TVViewPropsIOS, // 330ce7b5 TargetedEvent, // 16e98910 TaskProvider, // 266dedf2 - Text, // 608149e8 + Text, // 77d3bc9a TextContentType, // 239b3ecc TextInput, // 3b7016bb TextInputAndroidProps, // 3f09ce49 @@ -6241,7 +6242,7 @@ export { TextInputSelectionChangeEvent, // d4d10630 TextInputSubmitEditingEvent, // 22885c31 TextLayoutEvent, // 73ab173e - TextProps, // 4c29419c + TextProps, // deedb8f3 TextStyle, // bb9b7a58 ToastAndroid, // 88a8969a Touchable, // da3239ee