From 12acf900cb43925edcaea4cfda95d9a3701af358 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Thu, 29 Jul 2021 08:45:03 +0200 Subject: fixed highlighting bug --- pages/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pages') diff --git a/pages/index.tsx b/pages/index.tsx index 97f76af..69885e7 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -452,7 +452,7 @@ export const Graph = function (props: GraphProps) { const previouslyHighlightedLinks = useMemo( () => linksByNodeId[lastHoverNode.current?.id!] ?? [], - [hoverNode], + [JSON.stringify(hoverNode), lastHoverNode.current], ) const previouslyHighlightedNodes = useMemo( @@ -463,7 +463,7 @@ export const Graph = function (props: GraphProps) { ...previouslyHighlightedLinks.flatMap((link) => [link.source, link.target]), ].map((nodeId) => [nodeId, {}]), ), - [hoverNode, previouslyHighlightedLinks, lastHoverNode.current], + [JSON.stringify(hoverNode), previouslyHighlightedLinks, lastHoverNode.current], ) const getNodeColorById = (id: string) => { -- cgit v1.2.3