Skip to content

Commit dcf6291

Browse files
committed
Simplification.
1 parent 3a140bc commit dcf6291

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

lib/BigList.jsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -682,19 +682,14 @@ class BigList extends PureComponent {
682682
width: "100%",
683683
});
684684

685-
const getEmpty = () => {
686-
const props = {style: fullItemStyle};
687-
688-
return ListEmptyComponent
689-
? createElement(ListEmptyComponent, props)
690-
: renderEmpty
691-
? createElement(renderEmpty(), props)
692-
: null;
693-
}
694-
695685
// On empty list
696686
const isEmptyList = this.isEmpty();
697-
const emptyItem = getEmpty();
687+
const emptyItem = ListEmptyComponent
688+
? createElement(ListEmptyComponent, {style: fullItemStyle})
689+
: renderEmpty
690+
? createElement(renderEmpty(), {style: fullItemStyle})
691+
: null;
692+
698693
if (isEmptyList && emptyItem) {
699694
if (hideMarginalsOnEmpty || (hideHeaderOnEmpty && hideFooterOnEmpty)) {
700695
// Render empty
@@ -817,7 +812,7 @@ class BigList extends PureComponent {
817812
case BigListItemType.EMPTY:
818813
children.push(
819814
<React.Fragment key={itemKey}>
820-
{getEmpty()}
815+
{emptyItem}
821816
</React.Fragment>
822817
);
823818
break;

0 commit comments

Comments
 (0)