Remove unsubscription since component would unount when node changes
This commit is contained in:
@@ -173,13 +173,6 @@ class TreeNodeComponent extends React.Component<Props, State> {
|
|||||||
this.addSubscriber(treeNode)
|
this.addSubscriber(treeNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentWillReceiveProps(nextProps: Props) {
|
|
||||||
if (nextProps.treeNode !== this.props.treeNode) {
|
|
||||||
this.removeSubscriber(this.props.treeNode)
|
|
||||||
this.addSubscriber(nextProps.treeNode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
const { treeNode } = this.props
|
const { treeNode } = this.props
|
||||||
this.removeSubscriber(treeNode)
|
this.removeSubscriber(treeNode)
|
||||||
|
|||||||
Reference in New Issue
Block a user