Skip to content

Commit

Permalink
fixup! @uppy/informer: simplify render method (#3931)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 3, 2022
1 parent 386d72d commit 5fca617
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@uppy/informer/src/TransitionGroup.js
Expand Up @@ -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)
}
Expand Down

0 comments on commit 5fca617

Please sign in to comment.