iosreact-nativeexporeact-native-gesture-handlerreact-native-reanimated-v2

Drag to Scroll for Animated.ScrollView with Reanimated 2, React Native Gesture Handler, and Expo


Can anyone direct me to a good example of how to implement a draggable scroll view with Reanimated 2, react native gesture handler, in an expo project? I have a sample that is close, but it fails to scroll up or down on an iphone when you drag an item to the top or bottom. It does scroll but only a tiny bit and only while your finger is moving.

Snack: https://snack.expo.dev/@stewartarmbrecht/apple-music-drag-to-sort

This sample came from eveningkids gist: https://gist.github.com/eveningkid/00dc171095eb6d64f45afdbaa50a76c3.

Fantastic video here: https://www.youtube.com/watch?v=Ia2y0GDEuPc&t=9s


Solution

  • I think I figured it out. Need to move all logic that used withTiming out of the OnActive handler. https://snack.expo.dev/@stewartarmbrecht/apple-music-drag-and-sort-working