Skip to content

Commit 1c3f594

Browse files
huntiefacebook-github-bot
authored andcommitted
Add pointerEvents prop to TextProps (#56950)
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
1 parent 7cc8c76 commit 1c3f594

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/react-native/Libraries/Text/TextProps.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ export type TextPropsAndroid = {
124124
type TextBaseProps = Readonly<{
125125
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
126126

127+
/**
128+
* Controls whether the `Text` can be the target of touch events.
129+
*
130+
* See https://reactnative.dev/docs/view#pointerevents
131+
*/
132+
pointerEvents?: ?('auto' | 'box-none' | 'box-only' | 'none'),
133+
127134
/**
128135
* Whether fonts should scale to respect Text Size accessibility settings.
129136
* The default is `true`.

packages/react-native/ReactNativeApi.d.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a438af540f18c77572f05cef9481b7a6>>
7+
* @generated SignedSource<<cdee797f132aa0613dbaa11db73d93f9>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -5093,6 +5093,7 @@ declare type TextBaseProps = {
50935093
readonly onResponderTerminationRequest?: () => boolean
50945094
readonly onStartShouldSetResponder?: () => boolean
50955095
readonly onTextLayout?: (event: TextLayoutEvent) => unknown
5096+
readonly pointerEvents?: "auto" | "box-none" | "box-only" | "none"
50965097
readonly pressRetentionOffset?: PressRetentionOffset
50975098
readonly role?: Role
50985099
readonly selectable?: boolean
@@ -6008,7 +6009,7 @@ export {
60086009
AlertOptions, // a0cdac0f
60096010
AlertType, // 5ab91217
60106011
AndroidKeyboardEvent, // e03becc8
6011-
Animated, // 1a47480c
6012+
Animated, // fec47bfa
60126013
AppConfig, // ce4209a7
60136014
AppRegistry, // 5edf0524
60146015
AppState, // 12012be5
@@ -6228,7 +6229,7 @@ export {
62286229
TVViewPropsIOS, // 330ce7b5
62296230
TargetedEvent, // 16e98910
62306231
TaskProvider, // 266dedf2
6231-
Text, // 608149e8
6232+
Text, // 77d3bc9a
62326233
TextContentType, // 239b3ecc
62336234
TextInput, // 3b7016bb
62346235
TextInputAndroidProps, // 3f09ce49
@@ -6242,7 +6243,7 @@ export {
62426243
TextInputSelectionChangeEvent, // d4d10630
62436244
TextInputSubmitEditingEvent, // 22885c31
62446245
TextLayoutEvent, // 73ab173e
6245-
TextProps, // 4c29419c
6246+
TextProps, // deedb8f3
62466247
TextStyle, // bb9b7a58
62476248
ToastAndroid, // 88a8969a
62486249
Touchable, // da3239ee

0 commit comments

Comments
 (0)