Skip to content

Commit dae1e2e

Browse files
jony89jquense
authored andcommitted
Fix TransitionGroup error for v1 as well (#282)
* 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
1 parent 5f17ac9 commit dae1e2e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/TransitionGroup.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TransitionGroup extends React.Component {
9999
};
100100

101101
_handleDoneAppearing = (key, component) => {
102-
if (component.componentDidAppear) {
102+
if (component && component.componentDidAppear) {
103103
component.componentDidAppear();
104104
}
105105

@@ -126,7 +126,7 @@ class TransitionGroup extends React.Component {
126126
};
127127

128128
_handleDoneEntering = (key, component) => {
129-
if (component.componentDidEnter) {
129+
if (component && component.componentDidEnter) {
130130
component.componentDidEnter();
131131
}
132132

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

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

156156
_handleDoneLeaving = (key, component) => {
157-
if (component.componentDidLeave) {
157+
if (component && component.componentDidLeave) {
158158
component.componentDidLeave();
159159
}
160160

0 commit comments

Comments
 (0)