In official react-native documentation there is a section about Animated.event
method. As example they use following code:
onScroll={Animated.event(
// scrollX = e.nativeEvent.contentOffset.x
[{ nativeEvent: {
contentOffset: {
x: scrollX
}
}
}]
)}
I would like to map correct values to Animated.event
method and I would also like to map onScroll callback parameters to my own callback. Basically I would like to do something like this:
onScroll={(event) => {
myOwnCallback(event.nativeEvent.contentOffset.x)
Animated.event(
// scrollX = e.nativeEvent.contentOffset.x
[{nativeEvent: {
contentOffset: {
x: scrollX
}
}
}]
)
}}
Could you please explain how to do that?