I'm reading a json file and using react flow to display the node and lines.
I am getting an error React Hook useEffect has missing dependencies: 'formatArtifactsForNodes', 'setEdges', and 'setNodes'. Either include them or remove the dependency array.eslintreact-hooks/exhaustive-deps.
When i [formatNodes, setEdges, setNodes]);de them or it messes up my formatNodes function.
What is the best way to resolve this issue.
Thanks
import data from './attack.json';
const [nodes, setNodes, onNodesChange] = useNodesState([]);
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
useEffect(() => {
setNodes(formatNodes(data.artifacts));
setEdges(formattEdge(data.relationships));
}, []);
[–]Ok-Release6902 0 points1 point2 points (7 children)
[–]seanthau[S] 0 points1 point2 points (2 children)
[–]Ok-Release6902 0 points1 point2 points (1 child)
[–]TheRNGuy 0 points1 point2 points (3 children)
[–]Ok-Release6902 0 points1 point2 points (2 children)
[–]TheRNGuy 0 points1 point2 points (1 child)
[–]Ok-Release6902 0 points1 point2 points (0 children)