react-native/Libraries
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
..
ART Better error for ART <Group /> 2016-12-07 17:13:42 -08:00
ActionSheetIOS Redo exported headers and include paths for opensource 2016-12-07 15:28:29 -08:00
AdSupport Redo exported headers and include paths for opensource 2016-12-07 15:28:29 -08:00
Alert Ensure documentation has consistent relative links 2017-01-31 12:13:31 -08:00
Animated Add Animated.ValueXY.extractOffset 2017-02-03 12:14:09 -08:00
AppState docs(AppState.js): update example to ES6 2017-01-23 11:58:33 -08:00
BatchedBridge Remove obsolete mocks 2017-01-26 11:28:33 -08:00
BugReporting RN: Update React (2/2) 2016-11-04 05:43:44 -07:00
CameraRoll Ensure documentation has consistent relative links 2017-01-31 12:13:31 -08:00
Components Rename files to match @providesModule annotations 2017-02-03 15:58:58 -08:00
Core Deal with 0.38 'FlowFixMe's 2017-01-31 13:13:32 -08:00
CustomComponents Better ListView - FlatList 2017-02-04 10:28:47 -08:00
DebugComponentHierarchy Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
EventEmitter RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00
Experimental Better ListView - FlatList 2017-02-04 10:28:47 -08:00
Geolocation Update Geolocation.js 2017-01-31 11:58:30 -08:00
Image RN: Fix Type of `accessibilityLabel` in <Image> 2017-02-02 22:13:26 -08:00
Inspector Remove usages of RecyclerViewBackedScrollView in UIExplorer and NetworkOverlay 2017-01-28 10:43:35 -08:00
Interaction Replace jest.resetModuleRegistry() with jest.resetModules() 2016-12-18 17:13:38 -08:00
JSInspector Add Network agent 2016-11-02 12:29:15 -07:00
LayoutAnimation Mention that LayoutAnimation has to be explicitly enabled on A… 2016-11-25 15:28:28 -08:00
Linking Auto-fix lint errors 2016-08-09 06:43:46 -07:00
LinkingIOS Redo exported headers and include paths for opensource 2016-12-07 15:28:29 -08:00
Modal Add property to force HW acceleration on Android for modal windows 2016-12-14 10:28:33 -08:00
NativeAnimation Drive any numerical prop via NativeAnimated 2017-01-26 18:28:53 -08:00
NavigationExperimental Deal with 0.38 'FlowFixMe's 2017-01-31 13:13:32 -08:00
Network Deal with 0.38 'FlowFixMe's 2017-01-31 13:13:32 -08:00
Performance Updated Systrace and RCTRenderingPerf to sync w/ React changes 2017-01-22 09:58:32 -08:00
PermissionsAndroid Update PermissionsAndroid docs to use new APIs 2017-01-09 00:43:31 -08:00
PushNotificationIOS Handle push notifications on iOS 2017-02-03 11:58:30 -08:00
RCTTest Apple TV support 4: support for input (tvOS focus engine) 2016-12-19 06:28:40 -08:00
ReactNative Deal with 0.38 'FlowFixMe's 2017-01-31 13:13:32 -08:00
Renderer Deal with 0.38 'FlowFixMe's 2017-01-31 13:13:32 -08:00
Sample Fix missing RCTBridgeModule.h 2017-01-31 11:13:50 -08:00
Settings Redo exported headers and include paths for opensource 2016-12-07 15:28:29 -08:00
Share Update Share.js. Fixed bad grammar 2016-11-23 11:28:29 -08:00
Storage result in RCTAsyncStorage.multiGet could be null. 2016-12-15 22:43:30 -08:00
StyleSheet BREAKING - Improve JS transform validation, add tests 2017-02-02 06:28:31 -08:00
Text Better RTL support especially for ScrollView's 2017-02-02 09:58:30 -08:00
Utilities XHR: support typed arrays for request payloads 2017-01-20 18:43:27 -08:00
Vibration Redo exported headers and include paths for opensource 2016-12-07 15:28:29 -08:00
WebSocket XHR: support typed arrays for request payloads 2017-01-20 18:43:27 -08:00
react-native BREAKING: Move RecyclerViewBackedScrollView out of open source 2017-02-02 03:44:12 -08:00
vendor RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00
Promise.js Make onUnhandled safe for undefined errors 2016-08-02 07:58:28 -07:00
promiseRejectionIsError.js RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00