New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@uppy/informer: simplify render
method
#3931
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lost the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I have a duplicate at my place, let me take a look. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 5fca617, sorry for the trouble. |
||
const ref = linkRef(this, key); | ||
return cloneElement(childFactory(child), { ref, key }) | ||
}) | ||
|
||
return h(component, props, childrenToRender) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we are not solving / getting rid of the todo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My change has nothing to do with the TODO, the TODO comes from https://github.com/developit/preact-transition-group/blob/f4ad5e3121729819aa3670edb79388036fb60ebc/src/TransitionGroup.js#L199, it was written by folks more informed than I am, I'm too afraid to touch it at this point.