Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ui/src/components/graph/graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Graph = ({ data, nodeId }: Props) => {

useEffect(() => {
setElements(layoutedElements);
}, [layoutedElements, data, nodeId]);
}, [data, nodeId]); // eslint-disable-line react-hooks/exhaustive-deps

// Reset all node highlight status
const resetHighlight = useCallback((): void => {
Expand Down Expand Up @@ -68,7 +68,7 @@ const Graph = ({ data, nodeId }: Props) => {
}

setElements(values);
}, [elements]);
}, []); // eslint-disable-line react-hooks/exhaustive-deps

// Highlight path of selected node, including all linked up and down stream nodes
const highlightPath = useCallback(
Expand Down Expand Up @@ -124,7 +124,7 @@ const Graph = ({ data, nodeId }: Props) => {

setElements(values);
},
[elements, layoutedElements]
[] // eslint-disable-line react-hooks/exhaustive-deps
);

useEffect(() => {
Expand All @@ -135,7 +135,7 @@ const Graph = ({ data, nodeId }: Props) => {
highlightPath(node, !!nodeId);
}
}
}, [highlightPath, layoutedElements, resetHighlight, nodeId]);
}, [highlightPath, resetHighlight, nodeId]); // eslint-disable-line react-hooks/exhaustive-deps

// Fit the graph to the center of layout view when graph is initialized
const onLoad = (reactFlowInstance: OnLoadParams<unknown> | null) => {
Expand Down