-
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 rendering too much data, repeatedly #25825
Comments
Maybe we talking about the same BUG?! So here is the detailed Bug-Description with Screenshot |
@mrspeaker Can be related to |
I figured out following. BTW I suggest to improve the Documentation with a Note to watch (and set) these important Parameters to gain a good FlatList-Performance... and maybe reduce the default-value of windoSize to 5. It's important to analyse how much entries appear at your Screen, and which behavior you wan't to have while scrolling. In my example, first page has 8 ListItems (because a Searchfield is in the Header of the first Screen). Every additional Screen has 9 ListItems. For this, you have to think about (and set) following Parameters.
Very Important is:
If you not set windowSize, it's default is 21, means renders 10 Screen before and after your current Screen. For me this means 21 * 9 = 189 ListItems. |
https://github.com/ifsnow/react-native-infinite-flatlist-patch I made a patch library to help with this issue. I hope this helps. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Definitely not stale, and still happening. |
@ifsnow It doesn't work for me... |
Thank you saved my day |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
My app was being extremely janky whenever the FlatList first loaded - and it seemed to be rendering too much at once. I stripped it back to a very minimal project (only rendering a FlatList) and it appears that this behaviour is there too: rendering multiple times, and too much data.
However, I might be mistaken on how the component works and the issue could be elsewhere in my code.
React Native version:
Steps To Reproduce
The console.log should only be called one time for each initial chunk of items to be rendered. However it is logging many times. First it logs from index 0 to 9 (the first 10 elements of the array) then it immediately logs again from 0 to 30 (which is more than enough to fill the view), then immediately again from 0 to 180, and immediately again from 0 to 226.
Describe what you expected to happen:
I expected it only log for the initial rendered items. If I set
disableVirtualization: true
then the logs work "correctly" - only rendering the first chunk until you scroll down... but I don't think that is recommended!It seems that each item is re-rendered multiple times, and 226 elements are all rendered on the first page load . Though perhaps internally this is just a "first pass" and rendering is somehow deferred? Or the act of console.logging causing the rerenders?
The text was updated successfully, but these errors were encountered: