Skip to content

Commit

Permalink
fix: 修复类型推导异常
Browse files Browse the repository at this point in the history
  • Loading branch information
Kam committed Jan 11, 2024
1 parent d0c7641 commit f624ba6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/views/DemoA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ const edgeTypes = {
function DemoA() {
const reactFlowWrapper = useRef<HTMLDivElement>({} as HTMLDivElement)

const [reactFlowInstance, setReactFlowInstance] = useState<ReactFlowInstance>(null)
const [reactFlowInstance, setReactFlowInstance] = useState<ReactFlowInstance>({} 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],
Expand Down Expand Up @@ -117,7 +116,7 @@ function DemoA() {
>
<Controls/>
<MiniMap/>
<Background variant="dots" gap={ 12 } size={ 1 }/>
<Background gap={ 12 } size={ 1 }/>
</ReactFlow>
</div>
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/views/Edges/EdgeA/EdgeA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export default function EdgeA(props) {
<>
<BaseEdge
id={ id }
animated={ true }
className="react-flow__edge-interaction"
onMouseEnter={ () => console.log("enter edge") }
onMouseLeave={ () => console.log("leave edge") }
path={ edgePath }
/>
{
Expand Down

0 comments on commit f624ba6

Please sign in to comment.