Skip to content
This repository was archived by the owner on Jan 26, 2021. It is now read-only.

Fix crash when componentWillUnmount is called #188

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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: 5 additions & 3 deletions src/ParseComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ export default function(React) {

_unsubscribe() {
for (var name in this._subscriptions) {
this._subscriptions[name].dispose();
}
if (this._subscriptions[name] && this._subscriptions[name].dispose) {
this._subscriptions[name].dispose();
}
}
this._subscriptions = {};
}

Expand All @@ -165,4 +167,4 @@ export default function(React) {
this.forceUpdate();
}
}
};
};