diff --git a/src/components/tree/Tree.js b/src/components/tree/Tree.js index 51cedbad77..d67c6ccb00 100644 --- a/src/components/tree/Tree.js +++ b/src/components/tree/Tree.js @@ -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;