Skip to content

Commit 209c469

Browse files
committed
fix(android): update to match ReactNativeHost migration to Kotlin
1 parent 8aacfc3 commit 209c469

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/app/android/app/src/reacthost-0.76/java/com/microsoft/reacttetapp/react/MainReactNativeHost.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class MainReactNativeHost(
2626
private val reactBundleNameProvider: ReactBundleNameProvider
2727
) : com.microsoft.reacttestapp.compat.ReactNativeHostCompat(application) {
2828
val jsExecutorName: String
29-
get() = javaScriptExecutorFactory.toString()
29+
get() = getJavaScriptExecutorFactory().toString()
3030

3131
var source: BundleSource =
3232
if (reactBundleNameProvider.bundleName == null || isPackagerRunning(application)) {
@@ -37,6 +37,9 @@ class MainReactNativeHost(
3737

3838
var onBundleSourceChanged: ((newSource: BundleSource) -> Unit)? = null
3939

40+
private val application
41+
get() = getApplication() as TestApp
42+
4043
private var currentActivityTracker = CurrentActivityTracker()
4144

4245
private val reactInstanceEventListeners =
@@ -54,7 +57,7 @@ class MainReactNativeHost(
5457
beforeReactNativeInit()
5558

5659
if (BuildConfig.REACTAPP_USE_BRIDGELESS) {
57-
val reactHost = (application as TestApp).reactHost
60+
val reactHost = application.reactHost
5861
reactHost.addReactInstanceEventListener(object : ReactInstanceEventListener {
5962
override fun onReactContextInitialized(context: ReactContext) {
6063
// proactively removing the listener to avoid leaking memory

0 commit comments

Comments
 (0)