fix: correct module instead of react

This commit is contained in:
Hongarc 2019-04-25 10:02:00 +07:00
parent 64eb8ab773
commit 208a6c843a
5 changed files with 17 additions and 18 deletions

View file

@ -14,12 +14,17 @@ class LevelToolbarView extends React.Component {
};
}
componentWillUnmount() {
this._isMounted = false;
}
componentDidMount() {
this._isMounted = true;
this.setState({
isHidden: this.props.parent.getIsGoalExpanded()
isHidden: this.props.parent.getIsGoalExpanded(),
isGoalExpanded: this.props.parent.getIsGoalExpanded()
});
this.props.parent.on('goalToggled', function() {
if (!this.isMounted()) {
if (!this._isMounted) {
return;
}