- Fully cross-platform
- Configurable viewability callbacks
- List header support
- List footer support
- Item separator support
- Section header support
- Section separator support
- Heterogeneous data and item rendering support
- Pull to refresh
- Scroll loading
Example
Props
The actual data to render, akin to the
data prop in FlatList. Each section object should contain:data: Array of items in the sectionrenderItem: Optional custom renderer for items in this sectionItemSeparatorComponent: Optional custom separator for this section
Default renderer for every item in every section. Can be overridden on a per-section basis.
Rendered at the top of each section.
Rendered at the bottom of each section.
Used to extract a unique key for a given item at the specified index. Key is used for caching and as the react key to track item re-ordering.
Rendered in between each item, but not at the top or bottom of each section.
Rendered at the top and bottom of each section.
Rendered at the very beginning of the list.
Rendered at the very end of the list.
Rendered when the list is empty.
A marker property for telling the list to re-render (since it implements
PureComponent).How many items to render in the initial batch. This should be enough to fill the screen but not much more.
Reverses the direction of scroll. Uses scale transforms of -1.
Called once when the scroll position gets within
onEndReachedThreshold of the rendered content.If provided, a standard RefreshControl will be added for “Pull to Refresh” functionality.
Set this true while waiting for new data from a refresh.
This may improve scroll performance for large lists.
Makes section headers stick to the top of the screen until the next one pushes it up. Only enabled by default on iOS.
Methods
scrollToLocation()
sectionIndex and itemIndex positioned in the viewable area.
recordInteraction()
flashScrollIndicators()
Section Structure
Each section in thesections array should have the following structure:
Performance Tips
- Implement
getItemLayoutfor better scrolling performance - Use
keyExtractorto provide stable unique keys - Pass
extraDataif yourrenderItemdepends on external data - Consider using
removeClippedSubviewsfor very long lists