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) { 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`] = ` >
- - - +