diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 16be4f9f3989f9..a55f39188d03a8 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -2037,10 +2037,10 @@ public class com/facebook/react/defaults/DefaultReactActivityDelegate : com/face public final class com/facebook/react/defaults/DefaultReactHost { public static final field INSTANCE Lcom/facebook/react/defaults/DefaultReactHost; public static final fun getDefaultReactHost (Landroid/content/Context;Lcom/facebook/react/ReactNativeHost;)Lcom/facebook/react/ReactHost; - public static final fun getDefaultReactHost (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;Lcom/facebook/react/bridge/JSBundleLoader;)Lcom/facebook/react/ReactHost; - public static final fun getDefaultReactHost (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;Lcom/facebook/react/bridge/JSBundleLoader;Lkotlin/jvm/functions/Function1;)Lcom/facebook/react/ReactHost; - public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;Lcom/facebook/react/bridge/JSBundleLoader;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; - public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;Lcom/facebook/react/bridge/JSBundleLoader;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; + public static final fun getDefaultReactHost (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;)Lcom/facebook/react/ReactHost; + public static final fun getDefaultReactHost (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;Lkotlin/jvm/functions/Function1;)Lcom/facebook/react/ReactHost; + public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; + public static synthetic fun getDefaultReactHost$default (Landroid/content/Context;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/facebook/react/ReactHost; } public abstract class com/facebook/react/defaults/DefaultReactNativeHost : com/facebook/react/ReactNativeHost { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt index 1c17bc6e79c6ee..f0d0cdcaccb0d2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt @@ -61,7 +61,6 @@ public object DefaultReactHost { isHermesEnabled: Boolean = true, useDevSupport: Boolean = ReactBuildConfig.DEBUG, cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage> = emptyList(), - jsBundleLoader: JSBundleLoader? = null, ): ReactHost = getDefaultReactHost( context, @@ -71,8 +70,7 @@ public object DefaultReactHost { jsBundleFilePath, isHermesEnabled, useDevSupport, - cxxReactPackageProviders, - jsBundleLoader) { + cxxReactPackageProviders) { throw it } @@ -107,22 +105,20 @@ public object DefaultReactHost { isHermesEnabled: Boolean = true, useDevSupport: Boolean = ReactBuildConfig.DEBUG, cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage> = emptyList(), - jsBundleLoader: JSBundleLoader? = null, exceptionHandler: (Exception) -> Unit = { throw it }, ): ReactHost { if (reactHost == null) { val bundleLoader = - jsBundleLoader - ?: if (jsBundleFilePath != null) { - if (jsBundleFilePath.startsWith("assets://")) { - JSBundleLoader.createAssetLoader(context, jsBundleFilePath, true) - } else { - JSBundleLoader.createFileLoader(jsBundleFilePath) - } - } else { - JSBundleLoader.createAssetLoader(context, "assets://$jsBundleAssetPath", true) - } + if (jsBundleFilePath != null) { + if (jsBundleFilePath.startsWith("assets://")) { + JSBundleLoader.createAssetLoader(context, jsBundleFilePath, true) + } else { + JSBundleLoader.createFileLoader(jsBundleFilePath) + } + } else { + JSBundleLoader.createAssetLoader(context, "assets://$jsBundleAssetPath", true) + } val jsRuntimeFactory = if (isHermesEnabled) HermesInstance() else JSCInstance() val defaultTmmDelegateBuilder = DefaultTurboModuleManagerDelegate.Builder() cxxReactPackageProviders.forEach { defaultTmmDelegateBuilder.addCxxReactPackage(it) }