-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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 is not rendering the complete list of items. #39421
Comments
|
The StackOverflow link mentions removing Can you provide more details about when it happens as it sounds not consistent. There a couple things that sound weird to me.
|
I'm also facing the same issue after upgrading to React Native to 0.72.4. FlatList is only rendering the number of items defined in 'initialNumToRender'. Rest of the items are not getting rendered, so I'm not able to scroll over those items. |
I'm also facing the same problem. I upgraded my react native from 0.63..3 to 0.72.4 and suddenly my Flatlist stopped rendering views. Before upgrade It was working absolutely fine. <FlatList |
My flatlist worked finally. You have to put an empty check before you render flatlist "reviewQuestionArray.length >0". (reviewQuestionArray.length>0) && } |
Based on the answers above, I created a custom component to fix the issue:
|
I am facing the same issue after upgrading to version 0.72.4. The FlatList component is not rendering all the items. By default, it only renders around 10 items. If I specify a number in the 'initialNumToRender' prop, then only that number of items is displayed. |
Same issue only the first ~10 items gets rendered on 0.72.5, reverted back to 0.71.14, FlatList works there as expected. |
Running into the same issue on 0.72.5 on web only. For me, removing the Update: Removing React Native Element's Skeleton component from our header fixes this somehow? I recommend removing one component at a time and see if you have any luck. |
in my case for the first time, all the data was successfully rendered, but when I tried to go back until I exited the application and opened it again, only 10 data were displayed, and there was an empty space below, no data was displayed, but when I killed the app and opened it again, all of them running back to normal I don't know why this is, this happened when I updated to React Native 0.71.XX Has anyone experienced something similar in RN 0.71.XX? |
Related: #36766 |
Yes, we also had this issue in 0.71.12 |
I wouldn't recommend the empty check because you might have a ListEmptyComponent...see my solution here. |
We have the same problem in React Native 0.71.10 in the two FlatLists we have. |
I face the same issue when using react native 0.72.4. |
Same issue on 0.72.5 |
Finally I found a solution to this issue in my case. This issue occurs when returning from a screen that has a loading skeleton, when I go back until the application exits, this issue occurs. After I checked, because there was animation, I had to make sure whether there was any animation running so it was interfering with the rendering process maybe it could also be a reference for others. |
Same issue on react native 0.72.5 |
Same issue in 0.73.4. |
This comment was marked as resolved.
This comment was marked as resolved.
Is this bug the same as #36766 (comment) ? 🤔 |
Same issue on 0.72.13 |
For people having the same issue another thing to try is to make sure you don't use margins, try padding instead. I had the same issue and was fixed when I stop using vertical margin and replaced by vertical padding |
I got this issue on RN v73.6 as well. I think there is an issue with flatlist rendering.
Hope this might help |
How we managed to find our issue was turning on the InteractionManager debug flag directly in the node_modules: From there, we were able to see interaction handles being created, but not cleared. When the interaction handles were not cleared, FlatList would not render any data as it waits for all interactions to clear before rendering. Every create needs a clear. Specifically we used rn-range-slider and saw an issue with the implementation using a memo instead of a ref. The memo would re-render and create a new interaction handler leaving the pervious one open. Switching this to a ref fixed the issue for us. |
Description
It seems that there is a bug on the react-native flatlist while trying to render a list of items. Sometimes only some of the list items are displayed.
When there are interactions such as state changes, there is an update in the list and all the list items are displayed properly.
React Native Version
0.72.4
Output of
npx react-native info
System:
Binaries:
Node:
version: 16.20.0
Yarn:
version: 1.22.19
npm:
version: 8.19.4
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.2
- iOS 16.2
- macOS 13.1
- tvOS 16.1
- watchOS 9.1
Android SDK:
API Levels:
- "23"
- "28"
- "29"
- "30"
- "31"
- "32"
- "33"
- "34"
Build Tools:
- 29.0.2
- 30.0.2
- 30.0.3
- 31.0.0
- 33.0.0
- 34.0.0
Languages:
Java:
version: 11.0.15
Ruby:
version: 2.6.10
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: 0.72.4
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Steps to reproduce
We are using a FlatList to render a List of 500-1000 items based on a dynamic response. We are updating the states based on navigations and data filter.
However sometimes in the initial load of the page the Flatlist is rendering only 5 items and it is unable to render the remaining items when scrolling down.
When there are state changes after initial load of data, there is an update in the list and all the data items are displayed properly.
Snack, screenshot, or link to a repository
Attaching an example link only for depicting the flatlist configuration we use.
https://stackoverflow.com/questions/77036267/issue-flatlist-rendering-only-few-items-in-the-list
The text was updated successfully, but these errors were encountered: