mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix DefaultReactNativeHost assuming lazyViewManagers are always available (#43334)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43334 cortinico flagged that bridge + fabric regressed in 0.74, likely due to D53406841. Changelog: [Android][Fixed] Fix registration of ViewManagers in new renderer when not using lazyViewManagers. Reviewed By: fkgozali Differential Revision: D54551645 fbshipit-source-id: 0783030cd0d2900a3a254ae04c9ea4e51035272a
This commit is contained in:
committed by
Alex Hunt
parent
a9ec4203e1
commit
1151ea1247
+5
@@ -998,6 +998,11 @@ public class ReactInstanceManager {
|
||||
if (names != null) {
|
||||
uniqueNames.addAll(names);
|
||||
}
|
||||
} else {
|
||||
FLog.w(
|
||||
ReactConstants.TAG,
|
||||
"Package %s is not a ViewManagerOnDemandReactPackage, view managers will not be loaded",
|
||||
reactPackage.getClass().getSimpleName());
|
||||
}
|
||||
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
}
|
||||
|
||||
+11
-6
@@ -49,13 +49,18 @@ protected constructor(
|
||||
DefaultComponentsRegistry.register(componentFactory)
|
||||
|
||||
val viewManagerRegistry =
|
||||
ViewManagerRegistry(
|
||||
object : ViewManagerResolver {
|
||||
override fun getViewManager(viewManagerName: String) =
|
||||
reactInstanceManager.createViewManager(viewManagerName)
|
||||
if (lazyViewManagersEnabled) {
|
||||
ViewManagerRegistry(
|
||||
object : ViewManagerResolver {
|
||||
override fun getViewManager(viewManagerName: String) =
|
||||
reactInstanceManager.createViewManager(viewManagerName)
|
||||
|
||||
override fun getViewManagerNames() = reactInstanceManager.viewManagerNames
|
||||
})
|
||||
override fun getViewManagerNames() = reactInstanceManager.viewManagerNames
|
||||
})
|
||||
} else {
|
||||
ViewManagerRegistry(
|
||||
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext))
|
||||
}
|
||||
|
||||
FabricUIManagerProviderImpl(
|
||||
componentFactory, ReactNativeConfig.DEFAULT_CONFIG, viewManagerRegistry)
|
||||
|
||||
Reference in New Issue
Block a user