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

Prevent FlatList slow update on huge dataset #78

Merged
merged 1 commit into from
May 22, 2023

Conversation

jwallet
Copy link
Contributor

@jwallet jwallet commented May 18, 2023

the data used by FlatList can become quite large, to prevent React warning

VirtualizedList: You have a large list that is slow to update

you must only pass usefull data to renderItem and omit those that are not used. renderItem will compute much faster and the list will perform way better. React won't need to re-render that often if less props are passed, and it will do it faster because it does not have to recalculate every row because response was passed and is too big to evaluate between life cycles.

onRowClick : we get the actual row based on the id

@alexbrazier
Copy link
Owner

Thanks @jwallet, looks like a good improvement. I'll try to get this tested and merged shortly

Copy link
Owner

@alexbrazier alexbrazier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jwallet, looks good

@alexbrazier alexbrazier merged commit c2a8f68 into alexbrazier:master May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants