📜  scrollview vs flatlist - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:43.382000             🧑  作者: Mango

代码示例1
There's a big difference between FlatList and ScrollView

ScrollView will load the items (data for scrolling) immediately after the component has been loaded. As a result, all data will be stored in RAM, and you will be unable to use hundreds or thousands of items in it (due to low performance).

FlatList, on the other hand, has a better solution for this problem; it will mount 10 items (by default) to the screen, and as the user scrolls the view, other items will mount. It's a significant advantage to use FlatList instead of ScrollView.

You can use ScrollView for a small number of items and FlatList for even 10000 items.