kirillzyusko / react-native-keyboard-controller

Keyboard manager which works in identical way on both iOS and Android
https://kirillzyusko.github.io/react-native-keyboard-controller/
MIT License
1.62k stars 67 forks source link

fix: RN 0.75 compilation error #484

Closed kirillzyusko closed 3 months ago

kirillzyusko commented 3 months ago

📜 Description

Fixed compilation error:

> Task :compileReleaseKotlin FAILED
e: file:///Users/kirylziusko/IdeaProjects/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ThemedReactContext.kt:28:51 Type mismatch: inferred type is ThemedReactContext? but ReactContext was expected

💡 Motivation and Context

Before we passed ThemedReactContext directly to UIManagerHelper.getEventDispatcherForReactTag method. It actually works, because ThemedReactContext extends ReactContext and kotlin could cast types automatically.

But it looks like in RN 0.75 something has changed and CI jobs such as gradlew lint and gradlew build (which consumes latest artifacts from maven) started to fail. I've tried to cast it to ReactContext using as ReactContext construction (which is safe, because I'm not using ! or ? symbols) and it started to work again.

So I think we'll go with this fix 👀

📢 Changelog

Android

🤔 How Has This Been Tested?

Tested on CI.

📸 Screenshots (if appropriate):

image

📝 Checklist

github-actions[bot] commented 3 months ago

📊 Package size report

Current size Target Size Difference
144245 bytes 144235 bytes 10 bytes 📈