- What type of data can the FlatList component render?
- The FlatList expects an array of objects. The renderItem property takes a function that is responsible for rendering each item.
- The FlatList expects an object.
- It expects a function that returns an iterable.
- Why is the key property a requirement for each data item that's passed to FlatList?
- It isn't a requirement.
- So that the list knows how to sort the data values.
- So that the list can do efficient equality checks that help with the rendering performance during list data updates.
- How do you render list controls that stay in a fixed position during scrolling?
- By passing custom control components as children of FlatList.
- You can use the ListHeaderComponent property of FlatList.
- You can't have statically positioned list controls.
- How to you lazily load more data as the user scrolls through your list?
- You can provide a function to the onEndReached property of FlatList. This is called when the user nears the end of the list and the function can populate the list data with more data.
- You have to extend the FlatList class and respond to scroll events to figure out whether the end of the list has been reached yet.