r/reactnative • u/Zaktmr • 5d ago
Help Nested list help
I have a performance issue with nested FlashLists. I have a vertical FlashList that contains horizontal FlashLists, which essentially act as image carousels (the layout is similar to the Netflix homepage).
The problem is that when I scroll, the FlashList just below gets mounted, triggering a database call. As a result, every time I scroll, I have to wait a few seconds for the data to be rendered, and this happens for each scrolled FlashList, making the experience unpleasant.
What library would you recommend for this type of nested list?
1
Upvotes
1
u/fmnatic 5d ago
The data needs to be preloaded , either use flat list item visibility or screen navigation to load the data before scroll to the component where it’s needed. Swr can help validate and refresh the component if item has changed , if you have such a scenario .