react-native: onEndReached is not called on Android
I’m trying to implement endless listview on Android using the ListView
component, and both methods onScroll
and onEndReached
are not been fired.
Code
<ListView
dataSource={ this.state.dataSource }
onEndReached={() => {console.log('fetch more')}}
onEndReachedThreshold={10}
initialListSize={ 20 }
onScroll={() => { console.log('onScroll') }}
renderRow={(rowData) => <ProductRow {...rowData} /> }
/>
Additional Information
- React Native version:
0.38.0
and0.39.0
- Platform: Android
- Operating System: MacOS
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 19 (4 by maintainers)
I actually got this working quite well playing with onEndReachedThreshold prop. On IOS I set it to 0 and on Android to 1.
const isIOS = Platform.OS === ‘ios’; … onEndReachedThreshold={isIOS ? 0 : 1}
0.43.1 and Flatlist, onEndReached never called on Android
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we’re automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
@sexykodo you are my release saviour
Any nested ScrollView?
In this case, onEndReached or onScroll function will not be called on 2nd level of ScrollViews…