mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 00:40:07 +02:00
fix: CommandView
don't need to unmount itself
This commit is contained in:
parent
9f2c599d82
commit
562843fa2e
1 changed files with 0 additions and 6 deletions
|
@ -15,17 +15,11 @@ class CommandView extends React.Component{
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.command.on('change', this.updateStateFromModel, this);
|
this.props.command.on('change', this.updateStateFromModel, this);
|
||||||
this.props.command.on('destroy', this.onModelDestroy, this);
|
|
||||||
this.updateStateFromModel();
|
this.updateStateFromModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.props.command.off('change', this.updateStateFromModel, this);
|
this.props.command.off('change', this.updateStateFromModel, this);
|
||||||
this.props.command.off('destroy', this.onModelDestroy, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
onModelDestroy() {
|
|
||||||
ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(this).parentNode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStateFromModel() {
|
updateStateFromModel() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue