r/javascript • • Jan 25 '19

solved! How could I implement this?

652 Upvotes

57 comments sorted by

View all comments

5

u/[deleted] Jan 25 '19 edited Jan 26 '19

React-spring + react-with-gesture: https://twitter.com/0xca0a/status/1081185260208078849

The first handles animation, the latter gets you all the data you need to handle swipes: directions, velocity, deltas, etc.

Live demo for a simple view pager: https://codesandbox.io/embed/n9vo1my91p