Remove unsubscription since component would unount when node changes

This commit is contained in:
Thomas Nordquist
2019-04-25 00:05:33 +02:00
parent 749df70d5c
commit 2c5c218fd1

View File

@@ -173,13 +173,6 @@ class TreeNodeComponent extends React.Component<Props, State> {
this.addSubscriber(treeNode)
}
public componentWillReceiveProps(nextProps: Props) {
if (nextProps.treeNode !== this.props.treeNode) {
this.removeSubscriber(this.props.treeNode)
this.addSubscriber(nextProps.treeNode)
}
}
public componentWillUnmount() {
const { treeNode } = this.props
this.removeSubscriber(treeNode)