From dacfde228e4b33202de22dc581dee5b630d7c3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 24 Apr 2017 10:42:26 +0200 Subject: [PATCH] fix: check all props in shouldComponentUpdate --- src/Hierarchy.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Hierarchy.js b/src/Hierarchy.js index cd1fde9..1ec593f 100644 --- a/src/Hierarchy.js +++ b/src/Hierarchy.js @@ -163,7 +163,16 @@ class Hierarchy extends Component { } shouldComponentUpdate(nextProps) { - return treeSelector(nextProps) !== this.computedTree; + return ( + this.props.nodeRenderer !== nextProps.nodeRenderer || + this.props.rootRenderer !== nextProps.rootRenderer || + this.props.leafRenderer !== nextProps.leafRenderer || + this.props.onNodeClick !== nextProps.onNodeClick || + this.props.transition !== nextProps.transition || + this.props.width !== nextProps.width || + this.props.height !== nextProps.height || + treeSelector(nextProps) !== this.computedTree + ); } render() {