mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
769136ca3c
Summary:
This diff fixes the render of Text and TextInlineViews when using Fabric + StaticViewConfigs enabled
Similar to Bridgeless mode, we want TextNativeComponent to render "createReactNativeComponentClass('RCTVirtualText..." instead of NativeText.
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Text/TextNativeComponent.js?commit=f044696a1a273dec1fac227898f5603682d4b19d&lines=59
UIManager.hasViewManagerConfig returns false for all components when using StaticViewConfigs enabled.
I'm changing this method to return true when the component is supported by static view configs:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/RKJSModules/EntryPoints/Fb4aBundle.js?commit=4661488cc6aab5078dc6b2afcbb0624e887346d5&lines=81-94
This is correct because hasViewManagerConfig is a new method that's used ONLY in two callsites:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Text/TextNativeComponent.js?lines=59
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Utilities/deprecatedPropType.js?lines=24
Although, this can fail if "hasViewManagerConfig" is started to be used as "feature detection" (see next diffs of the stack)
I'm open to other suggestions (please comment in the diff
My current plan is:
- Land this diff (or similar) to unblock static view configs experiment next week
- Include all codeGenNativeComponents into the list of static view configs
- Migrate callsites of getViewManagerConfig() -> hasNativeConfig() (only for components that have static view configs)
- Think/Discuss/Plan long term plan about feature detection
changelog: [internal] internal
Reviewed By: yungsters
Differential Revision: D26427140
fbshipit-source-id: ce8bf00d6c9793ad17bdc65eb8476aaab63db066