flatlist scroll animation
import {Animated } from 'react-native'
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
render() {
return (
<AnimatedFlatList
refreshing={this.state.isLoading}
onRefresh={this.onRefresh}
contentContainerStyle={{ paddingTop: 200 }}
scrollEventThrottle={16} // <-- Use 1 here to make sure no events are ever missed
onScroll={this.props.onScroll}
data={data}
renderItem={this._renderItem}
keyExtractor={(item, i) => i}
/>
);
}
}
onScroll={
Animated.event(
[{ nativeEvent: { contentOffset: { y: scrollY } } }],
{ useNativeDriver: false }
)}