react-native-swipe-gestures icon indicating copy to clipboard operation
react-native-swipe-gestures copied to clipboard

Feature Request - onSwipeBegin

Open iway1 opened this issue 4 years ago • 1 comments

Right now, this component only supports running code when a swipe finishes. It'd be really nice if there was a way to trigger when a swipe begins.

iway1 avatar Dec 23 '21 15:12 iway1

You can simply extend this package by yourself for your use case and save the changes with patch-package until this is updated.

I added a move callback to make some nice animations where my view moves into the same direction the swipe is going.

For you it should be something like that if this helps you:

Add the following in the index.js of react-native-swipe-gestures (see image 1 marked positions) now you can simply add a callback to the GestureRecognizer component which will execute a method from your component. "swipebegincallback" is the callback prop where you should pass in your method. I think this is a fast solution for you, maybe this helps. Bildschirmfoto 2021-12-24 um 22 19 43

GaraGentor avatar Dec 24 '21 21:12 GaraGentor