Skip to content
Advertisement

React Native ScrollView inside an Animated.View to make Bumble-like swipe system

I’m currently working on a Bumble-like swipe system so I can swipe horizontally (thanks to an Animated.View and a PanResponder so I can move my view wherever I want), and vertically (because my view is longer than the height of my screen).

After a long day of search, I finally found a solution which permits to know if the user is scrolling horizontally or vertically in the PanResponder, then choose if i block the move or not

The problem is that my canMove() function’s console.log is printing null every time so only my vertical scroll is working currently. Otherwise, when i print my scrollType value in the onPanResponderMove, it changes well so I don’t understand why my canMove() function gets null

here’s my file so you can understand:

JavaScript

if you need more informations i’m there to give you. hope we’ll find a solution ! thanks

Advertisement

Answer

Try this, newbies <3

JavaScript
Advertisement