From 224892e2c91169bfb6449847409ff8740c59bfdc Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Fri, 14 Jun 2024 13:41:48 -0400 Subject: [PATCH] Updates ViewConfig types to delegate isInAParentText context Now that HostContext determination for Fabric is a DEV-only behavior, we can move the HostContext determination to resolve from the ViewConfig for a given type. Doing this will allow arbitrary types to register themselves as potential parents of raw text string children. This is the first of two diffs for react as we'll: 1. Add the new property to the ViewConfig types 2. Update React Native to include the `supportsRawText` property for `RCTText`, `RCTVirtualText`, `AndroidTextInput`, etc. 3. Switch the behavior of react to read from the ViewConfig rather than a static list of types. --- packages/react-native-renderer/src/ReactNativeTypes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native-renderer/src/ReactNativeTypes.js b/packages/react-native-renderer/src/ReactNativeTypes.js index 0b4f9a1045b84..917e3988c7b38 100644 --- a/packages/react-native-renderer/src/ReactNativeTypes.js +++ b/packages/react-native-renderer/src/ReactNativeTypes.js @@ -85,6 +85,7 @@ export type ViewConfig = $ReadOnly<{ }>, ... }>, + supportsRawText?: boolean, uiViewClassName: string, validAttributes: AttributeConfiguration, }>; @@ -92,6 +93,7 @@ export type ViewConfig = $ReadOnly<{ export type PartialViewConfig = $ReadOnly<{ bubblingEventTypes?: $PropertyType, directEventTypes?: $PropertyType, + supportsRawText?: boolean, uiViewClassName: string, validAttributes?: PartialAttributeConfiguration, }>;