Skip to content

Commit bbfa701

Browse files
committed
Fixed modal test
1 parent 6e316b1 commit bbfa701

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalLayoutController.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package com.reactnativenavigation.react.modal
22

33
import android.app.Activity
44
import com.facebook.react.bridge.ReactContext
5+
import com.facebook.react.uimanager.UIManagerHelper
56
import com.facebook.react.uimanager.UIManagerModule
7+
import com.facebook.react.uimanager.common.UIManagerType
68
import com.reactnativenavigation.options.Options
79
import com.reactnativenavigation.react.Constants
810
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController
@@ -35,17 +37,13 @@ class ModalLayoutController(
3537

3638
override fun sendOnNavigationButtonPressed(buttonId: String?) {
3739
if (buttonId == Constants.HARDWARE_BACK_BUTTON_ID) {
38-
val dispatcher = reactContext.getNativeModule(
39-
UIManagerModule::class.java
40-
)?.eventDispatcher
40+
val dispatcher = UIManagerHelper.getEventDispatcher(reactContext, UIManagerType.FABRIC)
4141
dispatcher?.dispatchEvent(RequestCloseModalEvent(getHostId()))
4242
}
4343
}
4444

4545
fun sendShowEvent() {
46-
val dispatcher = reactContext.getNativeModule(
47-
UIManagerModule::class.java
48-
)?.eventDispatcher
46+
val dispatcher = UIManagerHelper.getEventDispatcher(reactContext, UIManagerType.FABRIC)
4947
dispatcher?.dispatchEvent(ShowModalEvent(getHostId()))
5048
}
5149
}

0 commit comments

Comments
 (0)