From b34e56259aac7967c4973dca6374faa48aa131ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Tue, 27 May 2025 01:21:17 -0700 Subject: [PATCH] Remove TextAncestor import from rn-tester TextExample (#51603) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51603 In `rn-tester` TextAncestor was used to create a inlineView wrapper: ```js function InlineView(props) { return ( ); } ``` however, it is already done in View.js and TextAncestor shouldn't be used outside of react-native package: ```js if (hasTextAncestor) { return {actualView}; } return actualView; ``` Changelog: [Internal] Reviewed By: huntie Differential Revision: D75408231 fbshipit-source-id: 7f12278296dcfe56246f6b7065f5a094e4099f7a --- .../js/examples/Text/TextExample.ios.js | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/packages/rn-tester/js/examples/Text/TextExample.ios.js b/packages/rn-tester/js/examples/Text/TextExample.ios.js index f139c9a3d75..1515727f37e 100644 --- a/packages/rn-tester/js/examples/Text/TextExample.ios.js +++ b/packages/rn-tester/js/examples/Text/TextExample.ios.js @@ -28,21 +28,6 @@ const { TextInput, View, } = require('react-native'); -const TextAncestor = - require('react-native/Libraries/Text/TextAncestor').default; - -// TODO: Is there a cleaner way to flip the TextAncestor value to false? I -// suspect apps won't even be able to leverage this workaround because -// TextAncestor is not public. -/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's - * LTI update could not be added via codemod */ -function InlineView(props) { - return ( - - - - ); -} type TextAlignExampleRTLState = { isRTL: boolean, @@ -1352,20 +1337,20 @@ const examples = [ return ( This text has a view - + which has another text inside. And moreover, it has another view - + with another text inside! - + - + Because we need to go deeper. );