-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FlatList] FlatList onEndReached no work android #14312
Comments
Can you provide a minimal amount of code to reproduce this using Sketch? This is necessary for people to be able to see and debug the issue being reported. |
+1 onEndReached is called one or two times before the first load ends and data array is filled. This does not happen on iOS. |
I'm having this issue as well; onEndReached simply never fires. Here's a link to a sketch that reproduces the issue on android: https://snack.expo.io/SkNo3vn7- Very frustrating; haven't even been able to find a functional workaround. |
I had the same problem with onEndReached is not called on Android when FlatList is scrolled to the bottom when I have prop This issue only happen on Android but not iOS. |
same issue |
Same problem here. Changing the value of onEndReachedThreshold didn't fix the issue. |
+1, happening on android on react native 0.45 any solution? |
+1 same for me |
+1 |
I think this is not a bug. My FlatList trigger onEndReached once time. This is problem. When onEndReached trigger, we must get new data and append to the old data => FlatList change and onEndReached can be fire. |
@phumaster can you explain with sharing some code. Ty! |
My FlatList <FlatList
data={this.props.data.data}
renderItem={this.renderItem}
keyExtractor={this.keyExtractor}
initialNumToRender={10}
onEndReached={this.handleOnEndReached}
onEndReachedThreshold={0.5}
refreshing={fetching}
onRefresh={this.handleOnRefresh}
/> I get data. => FlatList have 10 Items when onEndReached fire i get data from api. Then I change data in reducer (I use Redux) let {data} = action.payload;
let hasData = data && data.results && data.results.length > 0;
state = {
...state,
fetched: true,
fetching: false,
data: hasData ? {data: [...state.data.data, ...data.results], nextPage: data.next_page} : {
data: [],
nextPage: -1
}
}; => FlatList has 20 Items. And onEndReached work!
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
I have a same problem. |
Still not fixed. Same problem here on Android. |
I found answer here , I initially tried all solutions given in github comments nothing worked, but finally check this answer which worked for me. Hope it will work for other too. |
+1 |
[RN 0.52.1 -Both iOS - Android] |
<FlatList
data={dataSource}
keyExtractor={(_, i) => i}
ItemSeparatorComponent={this._renderSeparator}
renderItem={({ item }) => this._renderListItem(item)}
onRefresh={() => this.handleRefresh()}
refreshing={refreshing}
onEndReached={() => this.handleLoadMore()}
onEndReachedThreshold={0.3}
/>
this is no work in android,
can work in ios
The text was updated successfully, but these errors were encountered: