react-native/Libraries/Experimental
Spencer Ahrens a3457486e3 Better ListView - FlatList
Summary:
We really need a better list view - so here it is!

Main changes from existing `ListView`:

* Items are "virtualized" to limit memory - that is, items outside of the render window are unmounted and their memory is reclaimed. This means that instance state is not preserved when items scroll out of the render window.
* No `DataSource` - just a simple `data` prop of shape `Array<any>`. By default, they are expected to be of the shape `{key: string}` but a custom `rowExtractor` function can be provided for different shapes, e.g. graphql data where you want to map `id` to `key`. Note the underlying `VirtualizedList` is much more flexible.
* Fancy `scrollTo` functionality: `scrollToEnd`, `scrollToIndex`, and `scrollToItem` in addition to the normal `scrollToOffset`.
* Built-in pull to refresh support - set set the `onRefresh` and `refreshing` props.
* Rendering additional rows is usually done with low priority, after any interactions/animations complete, unless we're about to run out of rendered content. This should help apps feel more responsive.
* Component props replace render functions, e.g. `ItemComponent: ReactClass<{item: Item, index: number}>` replaces `renderRow: (...) => React.Element<*>`
* Supports dynamic items automatically by using `onLayout`, or `getItemLayout` can be provided for a perf boost and smoother `scrollToIndex` and scroll bar behavior.
* Visibility callback replaced with more powerful viewability callback and works in vertical and horizontal mode on at least Android and iOS, but probably other platforms as well. Extra power comes from the `viewablePercentThreshold` that lets the client decide when an item should be considered viewable.

Demo:

https://www.facebook.com/groups/576288835853049/permalink/753923058089625/

Reviewed By: yungsters

Differential Revision: D4412469

fbshipit-source-id: e2d891490bf76fe14df49294ecddf78a58adcf23
2017-02-04 10:28:47 -08:00
..
SwipeableRow Fix <SwipeableRow /> layout. 2017-02-03 13:58:32 -08:00
__tests__ Better ListView - FlatList 2017-02-04 10:28:47 -08:00
FlatList.js Better ListView - FlatList 2017-02-04 10:28:47 -08:00
Incremental.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
IncrementalExample.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
IncrementalGroup.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
IncrementalPresenter.js Auto-fix lint errors 2016-08-09 06:43:46 -07:00
MetroListView.js Better ListView - FlatList 2017-02-04 10:28:47 -08:00
ViewabilityHelper.js Better ListView - FlatList 2017-02-04 10:28:47 -08:00
VirtualizeUtils.js Better ListView - FlatList 2017-02-04 10:28:47 -08:00
VirtualizedList.js Better ListView - FlatList 2017-02-04 10:28:47 -08:00
WindowedListView.js Better ListView - FlatList 2017-02-04 10:28:47 -08:00