From 0553326bbe3a72dc7eed1a225060f13f601b57cf Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Thu, 9 Jun 2022 15:11:26 +0300 Subject: [PATCH] Lodash: Refactor SlotComponent away from _.negate() --- packages/components/src/slot-fill/slot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/src/slot-fill/slot.js b/packages/components/src/slot-fill/slot.js index 60a32b63dba3b..0d8130895f321 100644 --- a/packages/components/src/slot-fill/slot.js +++ b/packages/components/src/slot-fill/slot.js @@ -2,7 +2,7 @@ /** * External dependencies */ -import { isFunction, isString, map, negate } from 'lodash'; +import { isFunction, isString, map } from 'lodash'; /** * WordPress dependencies @@ -79,7 +79,7 @@ class SlotComponent extends Component { // In some cases fills are rendered only when some conditions apply. // This ensures that we only use non-empty fills when rendering, i.e., // it allows us to render wrappers only when the fills are actually present. - negate( isEmptyElement ) + ( element ) => ! isEmptyElement( element ) ); return <>{ isFunction( children ) ? children( fills ) : fills };