Skip to content

Commit

Permalink
Fix to work enter animation with CSSTransitionGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed Feb 9, 2017
1 parent f00acae commit 2ad8818
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 2ad8818

Please sign in to comment.