Skip to content
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

Fix to work enter animation with CSSTransitionGroup #13

Merged
merged 1 commit into from Feb 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/CSSTransitionGroupChild.js
Expand Up @@ -125,6 +125,11 @@ class CSSTransitionGroupChild extends React.Component {
flushClassNameAndNodeQueue() {
if (!this.unmounted) {
this.classNameAndNodeQueue.forEach((obj) => {
// This is for to force a repaint,
// which is necessary in order to transition styles when adding a class name.
/* eslint-disable no-unused-expressions */
obj.node.scrollTop;
/* eslint-enable no-unused-expressions */
addClass(obj.node, obj.className);
});
}
Expand Down Expand Up @@ -165,6 +170,7 @@ class CSSTransitionGroupChild extends React.Component {
delete props.appearTimeout;
delete props.enterTimeout;
delete props.leaveTimeout;
delete props.children;
return React.cloneElement(React.Children.only(this.props.children), props);
}
}
Expand Down