Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.

Commit ebd7d20

Browse files
author
Olga Belyaeva
committed
Fixed bug with selectedNodes
1 parent ae2f106 commit ebd7d20

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GraphWorkspace.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export default class GraphWorkspace extends React.PureComponent {
1717
},
1818
};
1919

20-
componentDidUpdate(prevProps, prevState) {
21-
if (this.props.graph != prevProps.graph) {
22-
this.setState({selectedNodes:[]})
20+
componentWillReceiveProps(nextProps) {
21+
if (nextProps.graph !== this.props.graph) {
22+
this.setState({selectedNodes:[]});
2323
}
2424
}
2525

0 commit comments

Comments
 (0)