react-native/Libraries/Lists
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
..
ListView Update license headers for MIT license 2018-02-16 18:31:53 -08:00
__flowtests__ Update license headers for MIT license 2018-02-16 18:31:53 -08:00
__tests__ Don't wrap ListEmptyComponent in an extra view 2018-03-13 18:11:31 -07:00
FillRateHelper.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
FlatList.js StyleObj -> DangerouslyImpreciseStyleProp 2018-03-07 13:24:20 -08:00
MetroListView.js @allow-large-files Upgrade xplat/js to Flow v0.66 2018-02-16 20:24:57 -08:00
SectionList.js @allow-large-files Upgrade xplat/js to Flow v0.66 2018-02-16 20:24:57 -08:00
ViewabilityHelper.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
VirtualizeUtils.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
VirtualizedList.js Don't wrap ListEmptyComponent in an extra view 2018-03-13 18:11:31 -07:00
VirtualizedSectionList.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00