Skip to content

Commit ed5eef5

Browse files
huntiefacebook-github-bot
authored andcommitted
Add pointerEvents prop to TextProps (facebook#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 Reviewed By: cortinico Differential Revision: D106183960
1 parent d566838 commit ed5eef5

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<<88d962e8bf936576e85b897a4192f39a>>
7+
* @generated SignedSource<<32a24e0b95fe31cb0fd9f022f6e6d3fb>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -5043,6 +5043,7 @@ declare type TextBaseProps = {
50435043
readonly onResponderTerminationRequest?: () => boolean
50445044
readonly onStartShouldSetResponder?: () => boolean
50455045
readonly onTextLayout?: (event: TextLayoutEvent) => unknown
5046+
readonly pointerEvents?: "auto" | "box-none" | "box-only" | "none"
50465047
readonly pressRetentionOffset?: PressRetentionOffset
50475048
readonly role?: Role
50485049
readonly selectable?: boolean
@@ -5958,7 +5959,7 @@ export {
59585959
AlertOptions, // a0cdac0f
59595960
AlertType, // 5ab91217
59605961
AndroidKeyboardEvent, // e03becc8
5961-
Animated, // d3264d4b
5962+
Animated, // 58b532cf
59625963
AppConfig, // ce4209a7
59635964
AppRegistry, // 5edf0524
59645965
AppState, // 12012be5
@@ -6174,7 +6175,7 @@ export {
61746175
TVViewPropsIOS, // 330ce7b5
61756176
TargetedEvent, // 16e98910
61766177
TaskProvider, // 266dedf2
6177-
Text, // 0937861d
6178+
Text, // ef2e8026
61786179
TextContentType, // 239b3ecc
61796180
TextInput, // ee8f6f5d
61806181
TextInputAndroidProps, // 3f09ce49
@@ -6188,7 +6189,7 @@ export {
61886189
TextInputSelectionChangeEvent, // 1a6383cf
61896190
TextInputSubmitEditingEvent, // e3152e2d
61906191
TextLayoutEvent, // c3e8821d
6191-
TextProps, // fb3a9124
6192+
TextProps, // dabce68a
61926193
TextStyle, // bb9b7a58
61936194
ToastAndroid, // 88a8969a
61946195
Touchable, // a05e8365

0 commit comments

Comments
 (0)