From 005047445d1588c138bb1ebc380b5f90ccfadb34 Mon Sep 17 00:00:00 2001 From: Prathamesh Chavan Date: Fri, 18 Aug 2023 11:27:44 +0530 Subject: [PATCH] Fixed array length doesn't update --- src/components/Graph/CustomNode/TextNode.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Graph/CustomNode/TextNode.tsx b/src/components/Graph/CustomNode/TextNode.tsx index 4eba966d25c..8539a3bc5e4 100644 --- a/src/components/Graph/CustomNode/TextNode.tsx +++ b/src/components/Graph/CustomNode/TextNode.tsx @@ -100,7 +100,11 @@ const Node: React.FC = ({ node, x, y, hasCollapse = false }) => }; function propsAreEqual(prev: CustomNodeProps, next: CustomNodeProps) { - return prev.node.text === next.node.text && prev.node.width === next.node.width; + return ( + prev.node.text === next.node.text && + prev.node.width === next.node.width && + prev.node.data.childrenCount === next.node.data.childrenCount + ); } export const TextNode = React.memo(Node, propsAreEqual);