diff --git a/src/views/DemoA.tsx b/src/views/DemoA.tsx index 95aed30..cc9278e 100644 --- a/src/views/DemoA.tsx +++ b/src/views/DemoA.tsx @@ -38,14 +38,13 @@ const edgeTypes = { function DemoA() { const reactFlowWrapper = useRef({} as HTMLDivElement) - const [reactFlowInstance, setReactFlowInstance] = useState(null) + const [reactFlowInstance, setReactFlowInstance] = useState({} as ReactFlowInstance) const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes) const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges) const onConnect = useCallback( (connection: Connection) => { console.log("____", connection) - connection.type = "edgeA" setEdges((eds) => addEdge(connection, eds)) }, [setEdges], @@ -117,7 +116,7 @@ function DemoA() { > - + diff --git a/src/views/Edges/EdgeA/EdgeA.tsx b/src/views/Edges/EdgeA/EdgeA.tsx index ab86a07..448b5e9 100644 --- a/src/views/Edges/EdgeA/EdgeA.tsx +++ b/src/views/Edges/EdgeA/EdgeA.tsx @@ -24,10 +24,6 @@ export default function EdgeA(props) { <> console.log("enter edge") } - onMouseLeave={ () => console.log("leave edge") } path={ edgePath } /> {