Large Flatlist is not rendering all items
See original GitHub issueIs this a bug report?
This seems to be a bug of the FlatList while trying to render many items (more that 60-70).
Have you read the Contributing Guidelines?
(Write your answer here.)
Environment
We are using macOS and the issue happen on both iphone and android
react-native -v
: 0.45.1node -v
: 6.9.1npm -v
: 3.10.8yarn --version
:
Then, specify:
- Target Platform: iOS, Android
- Development Operating System: macOS
- Build tools: Xcode, Android Studio
Steps to Reproduce
We are using FlatList to render Message Items and after the Flatlist has been rendered we are using scrollToBottom to go to the last item. The Flatlist is working without any issues when having about 20 items, but when we have many items it is NOT always rendering them and not display them at all. We are having an example with 80 items and sometimes is rendering all of them but most of the times is rendering about 40.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:45 (3 by maintainers)
Top Results From Across the Web
expo - React Native - FlatList Not Rendering - Stack Overflow
In my case, where I'm rendering a custom component for each item in the list, it wasn't rendering because I accidentally had {}...
Read more >Optimizing Flatlist Configuration - React Native
The heavier your components are, the slower they render. Avoid heavy images (use a cropped version or thumbnail for list items, as small...
Read more >A deep dive into React Native FlatList - LogRocket Blog
FlatList is a React Native component that allows you to render lists with zero hassle and minimal code. Learn how to customize FlatList....
Read more >Displaying a List in React Native: Map Method or FlatList ...
Under the hood, FlatList uses the ScrollView component to render scrollable elements. However, unlike generic ScrollView, FlatList displays data lazily to save ...
Read more >React Native: Optimizing FlatList performance
1. Avoid inline functions. Inline functions are recreated every time component renders. · 2. Provide height value for every item · 3. Keep ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
For partial shown short list: added those values to FlatList and problem gone:
honestly i don’t know which one fixes the problem or if works for large data.
I solved the issue by removing
flex
style property from the container ofrenderItem
. Perhaps this is worth reporting as a separate issue linked specifically with the problematicflex
behavior 🤔