Skip to content

Commit

Permalink
Merge pull request #13 from koba04/fix-enter-animation
Browse files Browse the repository at this point in the history
Fix to work enter animation with CSSTransitionGroup
  • Loading branch information
jquense committed Feb 9, 2017
2 parents 459743c + 2ad8818 commit 2e03f4b
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 2e03f4b

Please sign in to comment.