Skip to content

Commit 60a75cf

Browse files
android: support react native 0.81 (#50)
1 parent b106909 commit 60a75cf

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

android/src/main/java/com/multiplemodals/RNTModalViewManager.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ class RNTModalViewManager : RNTModalViewManagerSpec<RNTModalView>() {
2222
override fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any> {
2323
val buildOf = "registrationName"
2424

25-
return MapBuilder.builder<String, Any>()
25+
val map = MapBuilder.builder<String, Any>()
2626
.put(PressBackEvent.NAME, MapBuilder.of(buildOf, PressBackEvent.REGISTRATION_NAME))
2727
.build()
28+
29+
return when (map) {
30+
is MutableMap<String, Any> -> map
31+
else -> map.toMutableMap()
32+
}
2833
}
2934

3035
override fun onDropViewInstance(view: RNTModalView) {

android/src/main/jni/CMakeLists.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,19 @@ else()
7474
)
7575
endif()
7676

77-
target_compile_options(
78-
${LIB_TARGET_NAME}
79-
PRIVATE
80-
-DLOG_TAG=\"ReactNative\"
81-
-fexceptions
82-
-frtti
83-
-std=c++20
84-
-Wall
85-
)
77+
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 81)
78+
target_compile_reactnative_options(${LIB_TARGET_NAME} PRIVATE)
79+
else()
80+
target_compile_options(
81+
${LIB_TARGET_NAME}
82+
PRIVATE
83+
-DLOG_TAG=\"ReactNative\"
84+
-fexceptions
85+
-frtti
86+
-std=c++20
87+
-Wall
88+
)
89+
endif()
8690

8791
target_include_directories(
8892
${CMAKE_PROJECT_NAME}

0 commit comments

Comments
 (0)