Skip to content

Commit

Permalink
Updates ViewConfig types to delegate isInAParentText context
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rozele committed Jun 14, 2024
1 parent 3154ec8 commit 224892e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-native-renderer/src/ReactNativeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ export type ViewConfig = $ReadOnly<{
}>,
...
}>,
supportsRawText?: boolean,
uiViewClassName: string,
validAttributes: AttributeConfiguration,
}>;

export type PartialViewConfig = $ReadOnly<{
bubblingEventTypes?: $PropertyType<ViewConfig, 'bubblingEventTypes'>,
directEventTypes?: $PropertyType<ViewConfig, 'directEventTypes'>,
supportsRawText?: boolean,
uiViewClassName: string,
validAttributes?: PartialAttributeConfiguration,
}>;
Expand Down

0 comments on commit 224892e

Please sign in to comment.