React-Native: Making load more on scroll for Android and IOS — when you already has a working function in onScroll | by Yang Nana | Medium

PHOTO EMBED

Sat Aug 15 2020 03:31:32 GMT+0000 (Coordinated Universal Time)

Saved by @rdemo

constructor (props) {
  super(props)
  this.state = {
    scrollY: new Animated.Value(0),
  }
}
render () {
const headerTranslate = this.state.scrollY.interpolate({
  inputRange: [0, HEADER_SCROLL_DISTANCE],
  outputRange: [0, -1 * HEADER_SCROLL_DISAPPEAR],
  extrapolate: 'clamp'
  })
  
  return (
  <View>
  //using the headerTranslate for my header
  <ScrollView
  scrollEventThrottle={16}
  onScroll={Animated.event(
    [{ nativeEvent: { contentOffset: { y: this.state.scrollY } } }]
  )}
  >...</ScrollView>
  </View>
  )
}
content_copyCOPY

https://medium.com/@yangnana11/react-native-making-load-more-on-scroll-for-android-and-ios-when-you-already-has-a-working-792d71e46148