Skip to content

Commit 224892e

Browse files
committed
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.
1 parent 3154ec8 commit 224892e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ export type ViewConfig = $ReadOnly<{
8585
}>,
8686
...
8787
}>,
88+
supportsRawText?: boolean,
8889
uiViewClassName: string,
8990
validAttributes: AttributeConfiguration,
9091
}>;
9192

9293
export type PartialViewConfig = $ReadOnly<{
9394
bubblingEventTypes?: $PropertyType<ViewConfig, 'bubblingEventTypes'>,
9495
directEventTypes?: $PropertyType<ViewConfig, 'directEventTypes'>,
96+
supportsRawText?: boolean,
9597
uiViewClassName: string,
9698
validAttributes?: PartialAttributeConfiguration,
9799
}>;

0 commit comments

Comments
 (0)