@@ -15,27 +15,29 @@ import com.facebook.react.defaults.DefaultReactNativeHost
15
15
import com.facebook.react.flipper.ReactNativeFlipper
16
16
import com.facebook.soloader.SoLoader
17
17
18
- import com.tarodemo.devmanager.TaroDevManager
19
- import com.tarodemo.devmanager.TaroReactNativeHost
20
-
21
18
class MainApplication : Application (), ReactApplication {
22
19
23
- companion object {
24
- lateinit var instance: MainApplication
25
- private set
26
- }
20
+ override val reactNativeHost: ReactNativeHost =
21
+ ReactNativeHostWrapper (this , object : DefaultReactNativeHost (this ) {
22
+ override fun getPackages (): List <ReactPackage > {
23
+ // Packages that cannot be autolinked yet can be added manually here, for example:
24
+ // packages.add(new MyReactNativePackage());
25
+ return PackageList (this ).packages
26
+ }
27
+
28
+ override fun getJSMainModuleName (): String = " index"
27
29
28
- private val mTaroReactNativeHost: TaroReactNativeHost = TaroReactNativeHost (this )
29
- private val mReactNativeHost: ReactNativeHost = ReactNativeHostWrapper (this , mTaroReactNativeHost)
30
+ override fun getUseDeveloperSupport (): Boolean = BuildConfig .DEBUG
30
31
31
- override val reactNativeHost: ReactNativeHost get() = mReactNativeHost
32
+ override val isNewArchEnabled: Boolean = BuildConfig .IS_NEW_ARCHITECTURE_ENABLED
33
+ override val isHermesEnabled: Boolean = BuildConfig .IS_HERMES_ENABLED
34
+ })
32
35
33
- fun getTaroReactNativeHost (): TaroReactNativeHost = mTaroReactNativeHost
36
+ override val reactHost: ReactHost
37
+ get() = getDefaultReactHost(this .applicationContext, reactNativeHost)
34
38
35
39
override fun onCreate () {
36
40
super .onCreate()
37
- instance = this
38
- TaroDevManager .init ()
39
41
SoLoader .init (this , false )
40
42
if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
41
43
// If you opted-in for the New Architecture, we load the native entry point for this app.
0 commit comments