Open dharmasat opened 5 years ago
I have the same issue. Currently, the way I am doing this is to keep a local state variable rangeX and set it like
onSwiping = (rangeX, rangeY) => { if (this.state.rangeX * rangeX <= 0) { this.setState({rangeX}); } };
What this does is it updates the rangeX only when the direction changes but this causes my JS Framerate to drop significantly, so I feel setting state in onSwiping isn't viable. I wish there was a onSwipingRight and onSwipingLeft method that just get called once based on the direction.
while is used to drag the card , i need to know the direction means Left or Right