Skip to content

Commit

Permalink
Fix TransitionGroup error for v1 as well (#282)
Browse files Browse the repository at this point in the history
* Fix TransitionGroup error for v1 as well

fixes #12 using #15 for v1 as well.

Not all of us has been moved to v2 (especially those of us who are still using `material-ui`  < v1-beta),
Yet, this is critical bug fix .

hopefully a version with that fix will be released soon ? :)

* Update TransitionGroup.js
  • Loading branch information
jony89 authored and jquense committed Jan 29, 2018
1 parent 5f17ac9 commit dae1e2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/TransitionGroup.js
Expand Up @@ -99,7 +99,7 @@ class TransitionGroup extends React.Component {
};

_handleDoneAppearing = (key, component) => {
if (component.componentDidAppear) {
if (component && component.componentDidAppear) {
component.componentDidAppear();
}

Expand All @@ -126,7 +126,7 @@ class TransitionGroup extends React.Component {
};

_handleDoneEntering = (key, component) => {
if (component.componentDidEnter) {
if (component && component.componentDidEnter) {
component.componentDidEnter();
}

Expand All @@ -143,7 +143,7 @@ class TransitionGroup extends React.Component {
performLeave = (key, component) => {
this.currentlyTransitioningKeys[key] = true;

if (component.componentWillLeave) {
if (component && component.componentWillLeave) {
component.componentWillLeave(this._handleDoneLeaving.bind(this, key, component));
} else {
// Note that this is somewhat dangerous b/c it calls setState()
Expand All @@ -154,7 +154,7 @@ class TransitionGroup extends React.Component {
};

_handleDoneLeaving = (key, component) => {
if (component.componentDidLeave) {
if (component && component.componentDidLeave) {
component.componentDidLeave();
}

Expand Down

0 comments on commit dae1e2e

Please sign in to comment.