From 5fca61733d50c0f7392149b5924ef059296f200f Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 3 Aug 2022 11:00:24 +0200 Subject: [PATCH] fixup! @uppy/informer: simplify `render` method (#3931) --- packages/@uppy/informer/src/TransitionGroup.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/@uppy/informer/src/TransitionGroup.js b/packages/@uppy/informer/src/TransitionGroup.js index cebce0256..1462a27ed 100644 --- a/packages/@uppy/informer/src/TransitionGroup.js +++ b/packages/@uppy/informer/src/TransitionGroup.js @@ -264,10 +264,12 @@ class TransitionGroup extends Component { render ({ childFactory, transitionLeave, transitionName, transitionAppear, transitionEnter, transitionLeaveTimeout, transitionEnterTimeout, transitionAppearTimeout, component, ...props }, { children }) { // TODO: we could get rid of the need for the wrapper node // by cloning a single child - const childrenToRender = Object.values(children).filter(Boolean).map(child => { + const childrenToRender = Object.entries(children).map(([key, child]) => { + if (!child) return undefined + const ref = linkRef(this, key); return cloneElement(childFactory(child), { ref, key }) - }) + }).filter(Boolean) return h(component, props, childrenToRender) }