diff --git a/packages/react-native/Libraries/Components/View/View.js b/packages/react-native/Libraries/Components/View/View.js index 0edf2e6820dd..a10c06231fbf 100644 --- a/packages/react-native/Libraries/Components/View/View.js +++ b/packages/react-native/Libraries/Components/View/View.js @@ -62,6 +62,7 @@ const View: React.AbstractComponent< }: ViewProps, forwardedRef, ) => { + const hasTextAncestor = React.useContext(TextAncestor); const _accessibilityLabelledBy = ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy; @@ -103,36 +104,42 @@ const View: React.AbstractComponent< const newPointerEvents = style?.pointerEvents || pointerEvents; - return ( - - - + const actualView = ( + ); + + if (hasTextAncestor) { + return ( + + {actualView} + + ); + } + + return actualView; }, );