From 7da377d83e31bf56f87d9ae9e91e239531bbc0e8 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Tue, 2 Jun 2026 10:11:47 -0700 Subject: [PATCH] Add pointerEvents prop to TextProps (#56950) 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 Reviewed By: cortinico 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 a34c29584d98..533abdc9deda 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<<88d962e8bf936576e85b897a4192f39a>> + * @generated SignedSource<<32a24e0b95fe31cb0fd9f022f6e6d3fb>> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -5043,6 +5043,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 @@ -5958,7 +5959,7 @@ export { AlertOptions, // a0cdac0f AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // d3264d4b + Animated, // 58b532cf AppConfig, // ce4209a7 AppRegistry, // 5edf0524 AppState, // 12012be5 @@ -6174,7 +6175,7 @@ export { TVViewPropsIOS, // 330ce7b5 TargetedEvent, // 16e98910 TaskProvider, // 266dedf2 - Text, // 0937861d + Text, // ef2e8026 TextContentType, // 239b3ecc TextInput, // ee8f6f5d TextInputAndroidProps, // 3f09ce49 @@ -6188,7 +6189,7 @@ export { TextInputSelectionChangeEvent, // 1a6383cf TextInputSubmitEditingEvent, // e3152e2d TextLayoutEvent, // c3e8821d - TextProps, // fb3a9124 + TextProps, // dabce68a TextStyle, // bb9b7a58 ToastAndroid, // 88a8969a Touchable, // a05e8365