Expose lazyViewManagers option on ReactNativeHost

Summary: Changelog: [Android][Added] Option to enable lazyViewManager support with `ViewManagerOnDemandReactPackage`

Reviewed By: RSNara

Differential Revision: D36130066

fbshipit-source-id: b8b04b46f59248baacdf1717f7e32b45e56dd2b8
This commit is contained in:
Pieter De Baets
2022-05-12 03:25:17 -07:00
committed by Facebook GitHub Bot
parent d493f45bd9
commit d4b59cd9d0
3 changed files with 14 additions and 12 deletions
@@ -74,6 +74,7 @@ public abstract class ReactNativeHost {
.setDevSupportManagerFactory(getDevSupportManagerFactory())
.setRequireActivity(getShouldRequireActivity())
.setSurfaceDelegateFactory(getSurfaceDelegateFactory())
.setLazyViewManagersEnabled(getLazyViewManagersEnabled())
.setRedBoxHandler(getRedBoxHandler())
.setJavaScriptExecutorFactory(getJavaScriptExecutorFactory())
.setUIImplementationProvider(getUIImplementationProvider())
@@ -135,6 +136,16 @@ public abstract class ReactNativeHost {
return true;
}
/**
* Returns whether view managers should be created lazily. See {@link
* ViewManagerOnDemandReactPackage} for details.
*
* @experimental
*/
public boolean getLazyViewManagersEnabled() {
return false;
}
/**
* Return the {@link SurfaceDelegateFactory} used by NativeModules to get access to a {@link
* SurfaceDelegate} to interact with a surface. By default in the mobile platform the {@link