A performant interface for rendering sectioned lists, supporting the most handy features:
If you don't need section support and want a simpler interface, use
If you need sticky section header support, use
ListView for now.
This is a convenience wrapper around
and thus inherits the following caveats:
PureComponentwhich means that it will not re-render if
propsremain shallow- equal. Make sure that everything your
renderItemfunction depends on is passed as a prop that is not
===after updates, otherwise your UI may not update on changes. This includes the
dataprop and parent component state.
keyprop on each item and uses that for the React key. Alternatively, you can provide a custom
Rendered in between adjacent Items within each section.
Rendered at the very end of the list.
Rendered at the very beginning of the list.
Rendered in between 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. The default extractor checks item.key, then falls back to using the index, like react does.
If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality. Make
sure to also set the
refreshing prop correctly.
Called when the viewability of rows changes, as defined by the
Set this true while waiting for new data from a refresh.
Default renderer for every item in every section. Can be over-ridden on a per-section basis.
Rendered at the top of each section. Sticky headers are not yet supported.
This is an optional optimization to minimize re-rendering items.
You can edit the content above on GitHub and send us a pull request!
|Edit on GitHub|