Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TransitionGroup error for v1 as well #282

Merged
merged 2 commits into from
Jan 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/TransitionGroup.js
Original file line number Diff line number Diff line change
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