Skip to content

Commit

Permalink
@uppy/informer: simplify render method (#3931)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 2, 2022
1 parent c477bff commit 38089a2
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/@uppy/informer/src/TransitionGroup.js
Expand Up @@ -264,17 +264,10 @@ 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 = []
for (const key in children) {
if (children.hasOwnProperty(key)) {
const child = children[key]
if (child) {
const ref = linkRef(this, key),
el = cloneElement(childFactory(child), { ref, key })
childrenToRender.push(el)
}
}
}
const childrenToRender = Object.values(children).filter(Boolean).map(child => {
const ref = linkRef(this, key);
return cloneElement(childFactory(child), { ref, key })
})

return h(component, props, childrenToRender)
}
Expand Down

0 comments on commit 38089a2

Please sign in to comment.