@@ -9,18 +9,17 @@ import com.facebook.react.ReactPackage
99import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111import com.facebook.react.defaults.DefaultReactNativeHost
12- import com.facebook.react.flipper.ReactNativeFlipper
1312import com.facebook.soloader.SoLoader
1413
1514class MainApplication : Application (), ReactApplication {
1615
1716 override val reactNativeHost: ReactNativeHost =
1817 object : DefaultReactNativeHost (this ) {
19- override fun getPackages (): List <ReactPackage > {
20- // Packages that cannot be autolinked yet can be added manually here, for example:
21- // packages.add(new MyReactNativePackage());
22- return PackageList ( this ).packages
23- }
18+ override fun getPackages (): List <ReactPackage > =
19+ PackageList ( this ).packages. apply {
20+ // Packages that cannot be autolinked yet can be added manually here, for example:
21+ // add(MyReactNativePackage())
22+ }
2423
2524 override fun getJSMainModuleName (): String = " index"
2625
@@ -31,7 +30,7 @@ class MainApplication : Application(), ReactApplication {
3130 }
3231
3332 override val reactHost: ReactHost
34- get() = getDefaultReactHost(this . applicationContext, reactNativeHost)
33+ get() = getDefaultReactHost(applicationContext, reactNativeHost)
3534
3635 override fun onCreate () {
3736 super .onCreate()
@@ -40,6 +39,5 @@ class MainApplication : Application(), ReactApplication {
4039 // If you opted-in for the New Architecture, we load the native entry point for this app.
4140 load()
4241 }
43- ReactNativeFlipper .initializeFlipper(this , reactNativeHost.reactInstanceManager)
4442 }
4543}
0 commit comments