software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
5.85k stars 954 forks source link

RNGH 2.16.0+ only supports React Native >=0.68.0 (Android) #2845

Closed dylmye closed 1 month ago

dylmye commented 1 month ago

Description

Changes in #2597 mean that RNGestureHandler's minimum RN version for 2.16.0 is 0.68.0. This is because the signature for onChildStartedNativeGesture changed in 0.68.0 (see 0.67.5, 0.68.0) and this PR changes the usage to the new signature. In particular, see line 81 for the change for RNGestureHandlerRootHelper.kt.

Please update the docs to reflect this compatibility change. It's not my fault we are stuck on an old RN version :-)

Steps to reproduce

  1. Attempt to install RNGH 2.16.0 on React Native template at version 0.67.5

Expected: it works as it's > 0.67.0 Actual:

e: [...]/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt: (81, 46): Type mismatch: inferred type is {RootView & ViewGroup} but MotionEvent! was expected
e: [...]/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt: (81, 56): Too many arguments for public abstract fun onChildStartedNativeGesture(androidEvent: MotionEvent!): Unit defined in com.facebook.react.uimanager.RootView

Snack or a link to a repository

n/a

Gesture Handler version

2.16.0

React Native version

0.67.5

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 1 month ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?