React Native onPanResponderMove seems to be called too rarely
Instead of trying to prevent PanResponder
from updating the pan.y
value, you could have the consumer of the pan
value use an interpolated
value instead. For example, if the borders were at 10
and 250
, you might use something like:
... style={{transform: [{translateY: this.state.pan.y.interpolate({ inputRange: [10, 250], outputRange: [10, 250], extrapolate: 'clamp' })}]}}
In the Release
method you would also need to clamp the values to within the borders, but the interpolate will prevent the animation from going too far.