My problem is I’m using Flatlist component to render items that are not pure components. they have a bunch of states, hooks, and many functions to handle logic. Moreover, my list also has many items, at least 28 items because I want to render some information in a month. the number of items may be bigger when I fetch more data for other months.
As a result, my app’s performance is really slow. Are there any solutions out there?
Question posted in React native
The official React Native documentation can be found here.
The official React Native documentation can be found here.
2
Answers
I think you have to use pagination to increase the performance. If you want the best possible performance with Flatlist you should do pre and post pagination. Like you have to add and remove equal amount of items from data array passed to Flatlist simultaneously.
i.e
let suppose you want to maintain the 50 items count in the array.
Try these alternatives
FlashList : Fast & Performant React Native List by Shopify
FlashList Documentation
RecyclerListView : High performance ListView for React Native and Web by Flipkart
Medium Documentation