I am trying out PanResponder, and started off of the example in the React Native documentation. I'll copy part of the example code here:
const Example = () => {
const pan = useRef(new Animated.ValueXY()).current;
const panResponder = useRef(
PanResponder.create({
onMoveShouldSetPanResponder: () => true,
onPanResponderGrant: () => {
pan.setOffset({
x: pan.x._value,
^^^^^^
y: pan.y._value,
^^^^^^
});
},
onPanResponderMove: Animated.event([null, { dx: pan.x, dy: pan.y }]),
onPanResponderRelease: () => {
pan.flattenOffset();
},
})
).current;
Problem is, I get an TS error in WebStorm I wasn't expecting (this being the official example code). Here's the exact error:
How do I get rid of this?
Thanks.