refactor(state): separate nodes and edges

This commit is contained in:
moklick
2021-10-19 11:09:49 +02:00
parent 3dc79276ad
commit 410b12946d
22 changed files with 634 additions and 537 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import ReactFlow, {
OnLoadParams,
Edge,
Node,
ElementChange,
NodeChange,
applyNodeChanges,
} from 'react-flow-renderer';
@@ -48,7 +48,7 @@ const StressFlow = () => {
setEdges(initialElements.edges);
};
const onNodesChange = useCallback((changes: ElementChange[]) => {
const onNodesChange = useCallback((changes: NodeChange[]) => {
setNodes((ns) => applyNodeChanges(changes, ns));
}, []);