How to use the react-swipeable.useSwipeable function in react-swipeable

To help you get started, we’ve selected a few react-swipeable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jxnblk / mdx-deck / packages / gatsby-theme / src / hooks / use-swipe.js View on Github external
next(context)
  }

  const onSwipedRight = e => {
    previous(context)
  }

  const onSwipedUp = e => {
    context.setState({ mode: modes.presenter })
  }

  const onSwipedDown = e => {
    context.setState({ mode: modes.normal })
  }

  const props = useSwipeable({
    onSwipedLeft,
    onSwipedRight,
    onSwipedUp,
    onSwipedDown,
  })

  return props
}

react-swipeable

React Swipe event handler hook

MIT
Latest version published 17 days ago

Package Health Score

92 / 100
Full package analysis

Popular react-swipeable functions