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);