onScroll with useNativeDriver
Opened this issue · 0 comments
ilya-raevskiy commented
How correctly will it be added to the code:
onScroll={
useNativeDriver
? Animated.event([{ nativeEvent: { contentOffset: { y: this.state.scrollY } } }], {
useNativeDriver: true,
listener: event => {
const offsetY = event.nativeEvent.contentOffset.y;
this.props.scrollFunc(offsetY);
},
})
: this.onScroll
}