react-native-swipe-gestures-recognizer
v1.0.0
Published
Gesture recognizer component made with react-native-gesture-handler
Downloads
6
Maintainers
Readme
react-native-swipe-gestures-recognizer
| | | | :---------------:|:----------------:|:-----------------:|:-----------------:|
Installation
Open a Terminal in the project root and run:
yarn add react-native-gestures-recognizer
or if you use npm
:
npm install react-native-gestures-recognizer
If you are using Expo, you are done.
If you don't use Expo, install and link react-native-gesture-handler.
Props
| name | required | default | description |
| ------------------------- | -------- | ------- | ------------|
| config | no | | the config object (todo)
| onSwipe | no | null | The function that runs on every swipe and returns swipeDirection
and PanGestureHandlerGestureEvent
| onSwipeUp | no | null | The function that runs when a SWIPE_UP is detected.
| onSwipeLeft | no | null | The function that runs when a SWIPE_LEFT is detected.
| onSwipeRight | no | null | The function that runs when a SWIPE_RIGHT is detected.
| onSwipeDown | no | null | The function that runs when a SWIPE_DOWN is detected.
Example
More complex examples can be found in the Example
folder.
yarn
cd Example
yarn
yarn start