1

I know there is react-native-gesture-handler. But their Swipeable has not implemented functionality that I need.

Now I a trying to implement my own Swipeable component. The logic is actually very simple.BUT the difficult part is when I put the Swipeable inside a scrollview. I have tried with react-native-gesture-handler Panguesturehandler to make the scrollview and swipeable work simultaneous. I then calculate the slope of the PanGesture and if it greater than some threshold, I do nothing (it only scrolls). And when the slope is below the threshold I deactivate the scroll of the scrollview and do my swipeable animation.

This works fine for the most part. But when a user ist swiping fast I get this weird little scroll. It prolly is due to the disabling of the scroll being to slow. Now I am wondering whether this is the right approach and how I could maybe do this another way so that It works as aspected. maybe someone of you knows how to do this or could explain to me how RNGH did it with their Swipeable. Theirs works perfectly. Thanks in advance!

See this for my source code: https://github.com/software-mansion/react-native-gesture-handler/discussions/2501

Allleex
  • 137
  • 9
  • Have you tried using RNGH's [scrollview](https://docs.swmansion.com/react-native-gesture-handler/docs/gesture-handlers/basics/about-handlers/#using-native-components) – PhantomSpooks Jun 02 '23 at 15:23
  • @PhantomSpooks Yeah I have tried that. I am using it. I am gonna later try with the gesture system from react native. Gonna be a pain but maybe that works by telling the components whether or not they should become responders – Allleex Jun 02 '23 at 16:44
  • I've tried to use [react-native-swipeable](https://github.com/jshanson7/react-native-swipeable) and [react-native-swipeable-item](https://github.com/computerjazz/react-native-swipeable-item/issues) but they werent working – PhantomSpooks Jun 02 '23 at 17:06
  • Im not sure. It kept saying the reanimated worklet didnt exist. I was getting the same error when i would try to use react-native-skia in expo so it might have something to do with the way the libraries were using reanimated – PhantomSpooks Jun 03 '23 at 13:52

0 Answers0