Skip to content

Commit 3efbe33

Browse files
hyochanfacebook-github-bot
authored andcommitted
Add pointerEvents support to Text component (#48081)
Summary: This PR adds `pointerEvents` to the `TextProps` type. ### Motivation: The `pointerEvents` property is already supported in `Text` components internally, but it was missing from the TypeScript definitions. By adding it to `TextProps`, developers can now use this property with full type safety and without TypeScript errors. This is a type-only change and does not introduce any functional modifications. ## Changelog: [GENERAL] [ADDED] - Added `pointerEvents` to `TextProps` type. Pull Request resolved: #48081 Test Plan: As this is a type-only update: - Verified that the `pointerEvents` property is now recognized when used with `Text` components in TypeScript projects. - Ensured there are no runtime changes or regressions by testing existing `Text` components for expected behavior. Reviewed By: cipolleschi Differential Revision: D66753454 Pulled By: javache fbshipit-source-id: c8f21b11daa6001a309b1d29fd6259101d11f5d2
1 parent 4134b1c commit 3efbe33

File tree

1 file changed

+6
-1
lines changed
  • packages/react-native/Libraries/Text

1 file changed

+6
-1
lines changed

packages/react-native/Libraries/Text/Text.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {Constructor} from '../../types/private/Utilities';
1212
import {AccessibilityProps} from '../Components/View/ViewAccessibility';
1313
import {NativeMethods} from '../../types/public/ReactNativeTypes';
1414
import {ColorValue, StyleProp} from '../StyleSheet/StyleSheet';
15-
import {TextStyle} from '../StyleSheet/StyleSheetTypes';
15+
import {TextStyle, ViewStyle} from '../StyleSheet/StyleSheetTypes';
1616
import {
1717
GestureResponderEvent,
1818
LayoutChangeEvent,
@@ -209,6 +209,11 @@ export interface TextProps
209209
* Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).
210210
*/
211211
minimumFontScale?: number | undefined;
212+
213+
/**
214+
* Controls how touch events are handled. Similar to `View`'s `pointerEvents`.
215+
*/
216+
pointerEvents?: ViewStyle['pointerEvents'] | undefined;
212217
}
213218

214219
/**

0 commit comments

Comments
 (0)