diff --git a/android/app/src/main/java/com/tarodemo/MainApplication.kt b/android/app/src/main/java/com/tarodemo/MainApplication.kt index 10b727a6..a430a768 100644 --- a/android/app/src/main/java/com/tarodemo/MainApplication.kt +++ b/android/app/src/main/java/com/tarodemo/MainApplication.kt @@ -28,7 +28,7 @@ class MainApplication : Application(), ReactApplication { private val mTaroReactNativeHost: TaroReactNativeHost = TaroReactNativeHost(this) private val mReactNativeHost: ReactNativeHost = ReactNativeHostWrapper(this, mTaroReactNativeHost) - override fun getReactNativeHost(): ReactNativeHost = mReactNativeHost + override val reactNativeHost: ReactNativeHost get() = mReactNativeHost fun getTaroReactNativeHost(): TaroReactNativeHost = mTaroReactNativeHost diff --git a/android/app/src/main/java/com/tarodemo/devmanager/TaroDevManager.kt b/android/app/src/main/java/com/tarodemo/devmanager/TaroDevManager.kt index 5b5423c7..b7386077 100644 --- a/android/app/src/main/java/com/tarodemo/devmanager/TaroDevManager.kt +++ b/android/app/src/main/java/com/tarodemo/devmanager/TaroDevManager.kt @@ -22,7 +22,7 @@ object TaroDevManager { } } - private val application = MainApplication.getInstance() + private val application = MainApplication.instance private val packagerConnectionSettings = PackagerConnectionSettings(application) private val reactNativeHost = application.reactNativeHost @@ -63,7 +63,7 @@ object TaroDevManager { } private fun setJsMainModuleName(jsMainModulePath: String) { - application.taroReactNativeHost.jsMainModulePath = jsMainModulePath + application.getTaroReactNativeHost().jsMainModulePath = jsMainModulePath } private fun reset() { @@ -96,4 +96,4 @@ object TaroDevManager { UiThreadUtil.runOnUiThread(runnable) } } -} \ No newline at end of file +}