Skip to content

Commit 61db53c

Browse files
[Native] Add RCTSelectableText as a recognized Text component (facebook#35780)
## Summary Add "RCTSelectableText" to the list of component names recognized as being inside a text element, alongside "RCTText". React Native's new text stack, tries to optimize and allows differentiating between a custom TextView, with lower level control, that can reuse the work performed during Fabric/Yoga layout, and a native TextView, used for fidelity. On Android at least, the only place we've needed native TextView for fidelity/native UX has been support for `selectable` text, which has many unique UI interactions. ## How did you test this change? When I patch this in, alongside facebook/react-native#55552, we no longer see warnings when we render text inside of RCTSelectableText component. --------- Co-authored-by: Eli White <github@eli-white.com>
1 parent 4ac4753 commit 61db53c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/react-native-renderer/src/ReactFiberConfigFabric.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export function getChildHostContext(
278278
const isInAParentText =
279279
type === 'AndroidTextInput' || // Android
280280
type === 'RCTMultilineTextInputView' || // iOS
281+
type === 'RCTSelectableText' ||
281282
type === 'RCTSinglelineTextInputView' || // iOS
282283
type === 'RCTText' ||
283284
type === 'RCTVirtualText';

packages/react-native-renderer/src/ReactFiberConfigNative.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ export function getChildHostContext(
275275
const isInAParentText =
276276
type === 'AndroidTextInput' || // Android
277277
type === 'RCTMultilineTextInputView' || // iOS
278+
type === 'RCTSelectableText' ||
278279
type === 'RCTSinglelineTextInputView' || // iOS
279280
type === 'RCTText' ||
280281
type === 'RCTVirtualText';

0 commit comments

Comments
 (0)