Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

Fixed array length doesn't update

Prathamesh Chavan005047445d15
diff --git a/src/components/Graph/CustomNode/TextNode.tsx b/src/components/Graph/CustomNode/TextNode.tsx
index 4eba966d..8539a3bc 100644
--- a/src/components/Graph/CustomNode/TextNode.tsx
+++ b/src/components/Graph/CustomNode/TextNode.tsx
@@ -100,7 +100,11 @@ const Node: React.FC<CustomNodeProps> = ({ 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);