I'm using a ListView component to display a simple list with section headers.
The ListView component has events for onEndReached but I could not find an onBeginningReached event.
How do you detect that a user has scrolled to the very top of the ListView?
There is no such callback provided. Here is a workaround in React Native .. I assume ReactJS should have something similar
<ListView onScroll={this.handleScroll.bind(this)} ... />
handleScroll(event) {
console.log(event.nativeEvent.contentOffset.y);
}
You can see that the value printed when scrolled on top will be negative. See if that works and help..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With