react-native/Libraries
Janic Duplessis db061ea8c7 Don't wrap ListEmptyComponent in an extra view
Summary:
A common UI pattern for list empty states is some text/images centered inside the visible part of the list. This is pretty hard to do currently because we wrap ListEmptyComponent with an extra view with no way to style it so we cannot just use `flex: 1` to make it fill the available space.

- Added an example of ListEmptyComponent in the FlatList example in RNTester

Before (no way to make ListEmptyComponent fill the space):
<img width="377" alt="screen shot 2018-03-05 at 5 24 15 pm" src="https://user-images.githubusercontent.com/2677334/37003152-129db3ac-209a-11e8-9600-110f10d57144.png">

After:
<img width="377" alt="screen shot 2018-03-05 at 5 09 20 pm" src="https://user-images.githubusercontent.com/2677334/37002809-e6971178-2098-11e8-8cf7-74bfb2f6a992.png">

- Tested some edge cases like returning null from the ListEmptyComponent

- Tested in an app that uses FlatList + ListEmptyComponent

[GENERAL] [MINOR] [VirtualizedList] - Don't wrap ListEmptyComponent in an extra view
Closes https://github.com/facebook/react-native/pull/18206

Differential Revision: D7266274

Pulled By: sahrens

fbshipit-source-id: 4636d2418474a4c86ac63e5e18a9afc391a518c5
2018-03-13 18:11:31 -07:00
..
ART Update license headers for MIT license 2018-02-16 18:31:53 -08:00
ActionSheetIOS Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Alert Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
Animated export CompositeAnimation type 2018-03-10 20:25:31 -08:00
AppState Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
BatchedBridge Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Blob Adding tests to cover regressions when upgrading to babel 7 2018-03-06 02:16:12 -08:00
BugReporting Update license headers for MIT license 2018-02-16 18:31:53 -08:00
CameraRoll @allow-large-files Upgrade xplat/js to Flow v0.66 2018-02-16 20:24:57 -08:00
Components Migrating View to be a Flow Typed ES6 class 2018-03-09 18:33:52 -08:00
Core Make fetchSegment native hook name consistent with __ prefix 2018-03-09 08:55:51 -08:00
EventEmitter Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Experimental @allow-large-files Upgrade xplat/js to Flow v0.66 2018-02-16 20:24:57 -08:00
Geolocation Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
Image Support Image resizeMode=repeat on Android 2018-03-12 16:14:18 -07:00
Inspector StyleObj -> DangerouslyImpreciseStyleProp 2018-03-07 13:24:20 -08:00
Interaction Update license headers for MIT license 2018-02-16 18:31:53 -08:00
JSInspector Update license headers for MIT license 2018-02-16 18:31:53 -08:00
LayoutAnimation Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Linking Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
LinkingIOS Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Lists Don't wrap ListEmptyComponent in an extra view 2018-03-13 18:11:31 -07:00
Modal Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
NativeAnimation Check PATENTS does not creep into files 2018-03-01 08:22:05 -08:00
Network Fix #8615: NetInfo.isConnected for iOS 2018-02-27 14:16:20 -08:00
Performance RN: Delete Systrace.swizzleJSON 2018-03-08 23:43:26 -08:00
PermissionsAndroid Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
PushNotificationIOS Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
RCTTest Update license headers for MIT license 2018-02-16 18:31:53 -08:00
ReactNative Loosen Platform check to allow better code sharing for out-of-tree platforms 2018-03-12 08:43:05 -07:00
Renderer Migrating View to be a Flow Typed ES6 class 2018-03-09 18:33:52 -08:00
Sample Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Settings Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Share Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Storage Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
StyleSheet Rename Style to DangerouslyImpreciseStyle 2018-03-08 01:08:42 -08:00
SurfaceBackedComponent Update license headers for MIT license 2018-02-16 18:31:53 -08:00
SurfaceHostingComponent Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Text Refactor RCTInputAccessoryView view hierarchy and names 2018-03-13 11:25:12 -07:00
Types RN: Flow Type for `PressEvent` 2018-02-25 23:27:00 -08:00
Utilities Don't truncate in the middle of an emoji 2018-03-12 12:33:54 -07:00
Vibration Fix ESLint warnings using 'yarn lint --fix' 2018-02-22 07:23:17 -08:00
WebSocket Remove Platform check from WebSocket module 2018-02-23 11:17:27 -08:00
Wrapper Update additional license headers 2018-03-08 12:10:14 -08:00
fishhook Merge fishhook.xcodeproj in RCTWebSocket 2017-08-09 07:48:09 -07:00
polyfills Update license headers for MIT license 2018-02-16 18:31:53 -08:00
react-native Update license headers for MIT license 2018-02-16 18:31:53 -08:00
vendor Update license headers for MIT license 2018-02-16 18:31:53 -08:00
.npmignore npmignore: ignore tests and fixtures 2018-02-27 08:42:14 -08:00
Promise.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
UTFSequence.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
promiseRejectionIsError.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00