0

I throw myself on your mercy asking for help figuring out why, in React Native using reanimated and PanGestureHandler, I can drag an object once, but when the gesture event ends and I update state, the secont->Nth drag animation doesn't happen anymore.

On my actual Android 9 device:

  1. I can drag the object right after the app loads, and I see the object follow my finger as I drag it (correct behavior)
    • The touch bubbles up to the parent container, which is not ideal, but that's something for me to deal with after this larger issue is resolved
  2. On the second drag, while my finger is down, the object appears stuck, and when I release my finger from the screen the object jumps to the new location (incorrect behavior)

Here's a snack that reproduces the problem, but here the problem I'm seeing on my actual Android 9 device happens with using the iOS emulation at snack.expo.io: https://snack.expo.io/@aproximation/react-native-draggable

libraries in use are:

  • React: 16.11.0
  • React Native: 0.63.2
  • React Native Gesture Handler: 1.6.0
  • React Native Reanimated: 1.13.0
  • Expo: 38.0.10

Lastly, I've also create an issue here in case it's a bug with React Native Gesture Handler: https://github.com/software-mansion/react-native-gesture-handler/issues/1194

Thank you!

aproximation
  • 491
  • 4
  • 13

1 Answers1

0

I ended up using Animated and PanResponder from react-native instead of PanGestureHandler, and that ended up working.

I updated the github issue linked to above with more details.

aproximation
  • 491
  • 4
  • 13