From 3ec922c24d273b207a0b1142a3e52770c9a6e43f Mon Sep 17 00:00:00 2001 From: AntoineDoubovetzky Date: Sun, 7 Apr 2019 11:16:26 +0200 Subject: [PATCH 1/2] remove wrapper around ListEmptyComponent --- Libraries/Lists/VirtualizedList.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 85f22f2675cb59..b64058851f9287 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -873,17 +873,19 @@ class VirtualizedList extends React.PureComponent { )): any); cells.push( - - {React.cloneElement(element, { - onLayout: event => { - this._onLayoutEmpty(event); - if (element.props.onLayout) { - element.props.onLayout(event); - } - }, - style: element.props.style, - })} - , + React.cloneElement(element, { + key: '$empty', + onLayout: event => { + this._onLayoutEmpty(event); + if (element.props.onLayout) { + element.props.onLayout(event); + } + }, + style: StyleSheet.compose( + inversionStyle, + element.props.style, + ), + }), ); } if (ListFooterComponent) { From c744c1a3e1efdf6f931418dc11be0353b66f2c73 Mon Sep 17 00:00:00 2001 From: AntoineDoubovetzky Date: Sun, 7 Apr 2019 12:17:51 +0200 Subject: [PATCH 2/2] update snapshot --- .../__tests__/__snapshots__/VirtualizedList-test.js.snap | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap b/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap index 32ec715a10ba71..2ae233201f72ba 100644 --- a/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap +++ b/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap @@ -668,11 +668,7 @@ exports[`VirtualizedList renders empty list with empty component 1`] = ` >
- - - +