Skip to content
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

FlashList not optimizing virtualization when nested #1432

Open
pfranklin-detechtion-com opened this issue Nov 26, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@pfranklin-detechtion-com

In react-native app, we are using an outer FlashList with a list of groups of items, displayed by List.Accordion (react-native-paper), and each group displays its list of items in another inner FlashList.

When the List.Accordion is expanded, the inner FlashList is not virtualizing the display of the items properly. It is immediately rendering and displaying the first batch of items, then calls renderItem() on all of the remaining items in the list all the way to the end. We have some groups with 1000's of items, so this takes 10+ seconds or more.

When using a FlashList not nested, just flat, the virtualization works smoothly. Logging the renderItem() function shows that it is just rendering each item as it scrolls closer to the viewable window. I created a snack that isolates this behavior: https://snack.expo.dev/LWIV8yrONzZw9Hshxm7f4

Is there some combination of properties on the FlashList or other components that can achieve the desired behavior here, so that the items are virtualized in a performant way?

Or is this just an inherent problem when nesting lists of variable length items? Is there a better way to approach this?

@pfranklin-detechtion-com pfranklin-detechtion-com added the bug Something isn't working label Nov 26, 2024
@ChronoByteCosmonaut
Copy link

Same issue 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants