FlatList data changed but refresh indicator not shows automatically
See original GitHub issueIs this a bug report?
when my flatList data changed, the layout changed but refresh indicator on top of flatList is not always shows loading automatically, I have to pull it down a little bit then the indicator stick on flatList, or it just shows at a blink when the data really changed, not shows at whole async data changed time as expected.
Have you read the Contributing Guidelines?
yes
Environment
react-native -v
: 0.46.0node -v
: v6.9.1npm -v
: 3.10.8yarn --version
: 0.24.5
-
Target Platform: iOS android works fine
-
Development Operating System: macOS
-
Build tools: Xcode
Steps to Reproduce
- set refreshing state to true then call api, but refresh indicator on flatList not always automatically pull down
- api back then data changed, it pull down at a blink, set refreshing state to false
Expected Behavior
loading indicator should show right after api called.
Actual Behavior
it shows and disappear quickly on data changed.
onRefresh = async () => {
this.setState({
isRefreshing: true
});
await this.props.searchProducts(this.state.searchString);
await this.setState({
data: this.props.products.searchProductsIds.map(
id => this.props.products.searchProductsById[id]
)
});
this.setState({
isRefreshing: false
});
};
<FlatList
removeClippedSubviews={false}
onRefresh={this.onRefresh}
refreshing={this.state.refreshing}
extraData={this.extraData}
data={this.state.data}
renderItem={this.renderItem}
keyExtractor={product => product.id}
contentContainerStyle={styles.listContainer}
onEndReached={this.handleLoadMore}
onEndReachedThreshold={5}
/>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:28
- Comments:31 (1 by maintainers)
Top Results From Across the Web
FlatList refreshing not showing when it's true during first load
The refresh indicator not showing even I've set the refreshing state to true in ProductList. But if I manually trigger from button click,...
Read more >FlatList - React Native
FlatList. A performant interface for rendering basic, flat lists, supporting the most handy features: Fully cross-platform.
Read more >React Native Pull-to-Refresh: Make Refreshing Easy for Users
The refreshing prop indicates whether the refresh is active or not. It should be set to true when you start fetching data and...
Read more >Display a List Using the FlatList Component in React Native
Since FlatList is a PureComponent , it assumes that the data is an immutable object and that any change in data is done...
Read more >How do I show an activity indicator every time my flatlist data ...
so your flatlist wont be shown since you set loading to true at the start of the function that gets the content, and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FlatList and SectionList is bad performance. Try this,please. may be it is a surprise for you
https://github.com/bolan9999/react-native-largelist
Just pass onRefresh props. If you’re not using onRefresh, just pass
onRefresh={ () => null }
. refreshing props will now work.