From 2ad8818b0fa4788774d0ed60b7bb2075eddc341e Mon Sep 17 00:00:00 2001 From: Toru Kobayashi Date: Thu, 9 Feb 2017 09:58:13 +0900 Subject: [PATCH] Fix to work enter animation with CSSTransitionGroup --- src/CSSTransitionGroupChild.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CSSTransitionGroupChild.js b/src/CSSTransitionGroupChild.js index d3f5baa5..bea150bc 100644 --- a/src/CSSTransitionGroupChild.js +++ b/src/CSSTransitionGroupChild.js @@ -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); }); } @@ -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); } }