From 135bc174ddbd067eaaa6b0b83ef8b3ac9bf0c1ba Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 1 Jun 2018 12:00:01 +0300 Subject: [PATCH] Fixed #429 --- src/components/tree/Tree.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;