1.

What is the difference between FlatList and SectionList?

Answer»

We can use FlatList or SectionList component to render a list of items on a MOBILE app. But there are differences between these two components PROVIDED by the react-native library. If you WANT to render a set of data broken into LOGICAL sections, maybe with section headers. It takes sections as props whose values is an array of object and each object should have title property. This titled property will be used by SectionList to render the list heading. But FlatList just iterates the list and create a NODE to render on UI. In case you want to show the header for a group of the list then you need to customize the node and add a header to it. The basic difference is heading for a group of a node is provided out of the box via SectionList component of react-native but with FlatList, we need to implement ourselves.



Discussion

No Comment Found