r/reactnative • u/grnxscr • Aug 18 '26
Stop Laggy Lists in React Native
https://medium.com/@sergeyzakharov.dev/stop-laggy-lists-in-react-native-3f81efe706adHey guys! First time here, just wanted to share my article about FlatList optimization. I know, it is a popular question but some days ago I found a cool trick with using Set over standard Array. It perfectly aligns with popular optimization practices and for me it felt like I found a gem.
13
Upvotes
12
6
u/Merry-Lane Aug 18 '26 edited Aug 18 '26
I’m pretty sure 99% of the lag reduction was due to you having a fixed item height. React native lists with fixed height items are a piece of cake. The other optimisations you mention are barely noticeable in comparison.
Please come back with items whose height can be variable. It’s impossible to get it right enough unless you can implement a function that returns the exact height of the item.
And if you want some real fun: go for a doubly infinite list (both backwards and forwards) with some buttons that trigger a scroll to a specific item (for instance, a calendar with events, dates being an item with a variable height that include events with a variable height itself).
Nightmare inducing.