You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-swipe-gesture-handler

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-swipe-gesture-handler

This package will help you to manage swipe gestures in your react native application.

1.0.6
latest
Source
npmnpm
Version published
Weekly downloads
385
38.99%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-swipe-gesture-handler

This is a simple react native geture handler package which will save you tons of hours to detect the gesture handle for swiping on your phone.

How to install

yarn add react-native-swipe-gesture-handler

Import

import { SwipeGesture } from "react-native-swipe-gesture-handler";

Define a handler Function

    const onSwipePerformed = (action) => {
      
      switch(action){
        case 'left':{
          console.log('left Swipe performed'); 
          break;
        }
         case 'right':{ 
          console.log('right Swipe performed');
          break;
        }
         case 'up':{ 
          console.log('up Swipe performed'); 
          break;
        }
         case 'down':{ 
          console.log('down Swipe performed'); 
          break;
        }
         default : {
         console.log('Undeteceted action');
         }
      }
    }

Add Swipte Gesture around your View or other component

    <SwipeGesture  
    onSwipePerformed={onSwipePerformed} 
    >
          <View>
          Your View Component
          </View>

    </SwipeGesture>

Keywords

react-native-swipe-gesture-handler

FAQs

Package last updated on 07 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts