diff --git a/index.js b/index.js index bf4045fa..3666b25f 100644 --- a/index.js +++ b/index.js @@ -437,7 +437,7 @@ var TransitionGroup = function (_React$Component) { if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) { // This entered again before it fully left. Add it again. _this.performEnter(key); - } else { + } else if (component) { _this.setState(function (state) { var newChildren = Object.assign({}, state.children); delete newChildren[key]; diff --git a/src/TransitionGroup.js b/src/TransitionGroup.js index 2cba6a6a..726b3fed 100644 --- a/src/TransitionGroup.js +++ b/src/TransitionGroup.js @@ -174,7 +174,7 @@ class TransitionGroup extends React.Component { if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) { // This entered again before it fully left. Add it again. this.performEnter(key); - } else { + } else if (component) { this.setState((state) => { let newChildren = Object.assign({}, state.children); delete newChildren[key];