fixup! @uppy/informer: simplify render method (#3931)

This commit is contained in:
Antoine du Hamel 2022-08-03 11:00:24 +02:00
parent 386d72d9f4
commit 5fca61733d
No known key found for this signature in database
GPG key ID: 21D900FFDB233756

View file

@ -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)
}