Shopify / flash-list

A better list for React Native
https://shopify.github.io/flash-list/
MIT License
5.43k stars 279 forks source link

scrollEnabled don't remove ScrollViews component #822

Open mgiorgi-github opened 1 year ago

mgiorgi-github commented 1 year ago

Hi, i've FlashList inside ScrollViews component, i've set scrollEnabled=false in order to remove scroll component but i've this error: VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead. I've to use FlashList into a lot of parts of my app but for one i've to put it into ScrollViews component and i want disable scroll for remove error, is possible? Thanks

hirbod commented 1 year ago

You should never put a FlashList inside a ScrollView, unless the direction is different. So having a horizontal FlashList inside a vertical ScrollView is fine, but not if both are in the same direction.

Furthermore, you should not use ScrollView at all.

Use a FlashList and render another FlashList in that case. But as well, only when they are not in the same scroll direction. Elements inside ScrollView render all at once and not lazy at all.