diff --git a/src/addons/transitions/ReactCSSTransitionGroupChild.js b/src/addons/transitions/ReactCSSTransitionGroupChild.js index 170cb9d87d67b..1e84536610468 100644 --- a/src/addons/transitions/ReactCSSTransitionGroupChild.js +++ b/src/addons/transitions/ReactCSSTransitionGroupChild.js @@ -89,7 +89,7 @@ var ReactCSSTransitionGroupChild = React.createClass({ CSSCore.addClass(node, className); // Need to do this to actually trigger a transition. - this.queueClass(activeClassName); + this.queueClass(activeClassName, node); // If the user specified a timeout delay. if (userSpecifiedDelay) { @@ -102,8 +102,9 @@ var ReactCSSTransitionGroupChild = React.createClass({ } }, - queueClass: function(className) { + queueClass: function(className, nodeRef) { this.classNameQueue.push(className); + this.nodeRef = nodeRef; if (!this.timeout) { this.timeout = setTimeout(this.flushClassNameQueue, TICK); @@ -113,7 +114,7 @@ var ReactCSSTransitionGroupChild = React.createClass({ flushClassNameQueue: function() { if (this.isMounted()) { this.classNameQueue.forEach( - CSSCore.addClass.bind(CSSCore, ReactDOM.findDOMNode(this)) + CSSCore.addClass.bind(CSSCore, this.nodeRef) ); } this.classNameQueue.length = 0; @@ -132,6 +133,9 @@ var ReactCSSTransitionGroupChild = React.createClass({ this.transitionTimeouts.forEach(function(timeout) { clearTimeout(timeout); }); + if (this.nodeRef) { + this.nodeRef = null; + } }, componentWillAppear: function(done) {