question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Large Flatlist is not rendering all items

See original GitHub issue

Is 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

  1. react-native -v: 0.45.1
  2. node -v: 6.9.1
  3. npm -v: 3.10.8
  4. yarn --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:closed
  • Created 6 years ago
  • Reactions:14
  • Comments:45 (3 by maintainers)

github_iconTop GitHub Comments

62reactions
kuriel-trivucommented, Jan 23, 2019

For partial shown short list: added those values to FlatList and problem gone:

<FlatList style={{ flex: 0 }}
                    initialNumToRender={data.length}

honestly i don’t know which one fixes the problem or if works for large data.

29reactions
simonas88commented, Nov 11, 2018

I solved the issue by removing flex style property from the container of renderItem. Perhaps this is worth reporting as a separate issue linked specifically with the problematic flex behavior 🤔

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found