Skip to content

Commit

Permalink
Fixed #429
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jun 1, 2018
1 parent 3d9c226 commit 135bc17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/tree/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ export class TreeNode extends Component {
}

static getDerivedStateFromProps(nextProps, prevState) {
if(prevState.expanded !== nextProps.node.expanded) {
let nextNode = nextProps.node;
if(nextNode.hasOwnProperty("expanded") && prevState.expanded !== nextNode.expanded) {
return {
expanded: nextProps.node.expanded
expanded: nextNode.expanded
};
}
return null;
Expand Down

0 comments on commit 135bc17

Please sign in to comment.