I want to detect swipe up/down/left/right on a div(touchableOpacity) after long-press in react native. Just swipe up will do, for now, as I can make the others on my own using that. So the process would be
long press a container
call a function that starts tracking the touches and uses if/else to decide if swipe up or not
<TouchableOpacity onLongPress={()=>swipeUp()}/>
where swipe will be something like this
const swipeUp = () => {
//track touch start y axis
//track touch end y axis
//if difference greater than 10, it's swipe up
// randomFunctionCalled
//else no response
}
I don't want to use any complicated library and I already tried the simple ones which didn't give optimal performance