mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38:50 +02:00
Merge pull request #670 from Hongarc/fix/unmount
fix: `CommandView` don't need to unmount itself
This commit is contained in:
commit
67664cc2c0
1 changed files with 0 additions and 6 deletions
|
@ -15,17 +15,11 @@ class CommandView extends React.Component{
|
|||
|
||||
componentDidMount() {
|
||||
this.props.command.on('change', this.updateStateFromModel, this);
|
||||
this.props.command.on('destroy', this.onModelDestroy, this);
|
||||
this.updateStateFromModel();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.command.off('change', this.updateStateFromModel, this);
|
||||
this.props.command.off('destroy', this.onModelDestroy, this);
|
||||
}
|
||||
|
||||
onModelDestroy() {
|
||||
ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(this).parentNode);
|
||||
}
|
||||
|
||||
updateStateFromModel() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue