mateusz1913 / react-native-avoid-softinput

Native solution for common React Native problem of focused views being covered by soft input view.
https://mateusz1913.github.io/react-native-avoid-softinput/
MIT License
701 stars 19 forks source link

Build fails in RN0.76 #211

Open johnf opened 5 hours ago

johnf commented 5 hours ago

Environment

Library version: 6.0.1 OS version: Android Pixel 7

Affected platforms

Current behavior

Task :react-native-avoid-softinput:compileDebugKotlin FAILED e: file:///home/johnf/work/gladly/mobile/node_modules/react-native-avoid-softinput/android/src/newarch/java/com/reactnativeavoidsoftinput/AvoidSoftInputViewManager.kt:35:16 Type mismatch: inferred type is ReactViewGroup? but ReactViewGroup was expected

Expected behavior

No build error

Reproduction

I think this isn't needed given it's a build error but I can create one if needed

johnf commented 4 hours ago

FYI: Not sure if correct but this allows it to compile

diff --git a/android/src/newarch/java/com/reactnativeavoidsoftinput/AvoidSoftInputViewManager.kt b/android/src/newarch/java/com/reactnativeavoidsoftinput/AvoidSoftInputViewManager.kt
index 0dae51e16646ee05035dd09331db2224b8cac2ea..35b4cb9482d177122c3616b070644476ead015af 100644
--- a/android/src/newarch/java/com/reactnativeavoidsoftinput/AvoidSoftInputViewManager.kt
+++ b/android/src/newarch/java/com/reactnativeavoidsoftinput/AvoidSoftInputViewManager.kt
@@ -30,7 +30,7 @@ class AvoidSoftInputViewManager :
     override fun prepareToRecycleView(
         reactContext: ThemedReactContext,
         view: ReactViewGroup
-    ): ReactViewGroup {
+    ): ReactViewGroup? {
         (view as AvoidSoftInputView).cleanup()
         return super.prepareToRecycleView(reactContext, view)
     }