How can I update multiple animated values with a single gesture handler in React Native? I want to do something like this, but update the scale value as well as another value.
let scale = new Animated.Value(1)
let foo = new Animated.Value(1)
const onPinchEvent = Animated.event(
[
{
nativeEvent: { scale: scale }
},
{
nativeEvent: { focalX: foo }
}
],
{
listener: (event) => console.log(event.nativeEvent),
useNativeDriver: true
}
)
I get this error:
Invariant Violation: Event has less arguments than mapping