diff --git a/examples/react/src/examples/CustomNode/index.tsx b/examples/react/src/examples/CustomNode/index.tsx index 986638a0..22433db0 100644 --- a/examples/react/src/examples/CustomNode/index.tsx +++ b/examples/react/src/examples/CustomNode/index.tsx @@ -7,7 +7,6 @@ import { Node, Position, SnapGrid, - Connection, useEdgesState, Background, Edge, @@ -15,6 +14,7 @@ import { OnInit, applyNodeChanges, OnNodesChange, + OnConnect, } from '@xyflow/react'; import ColorSelectorNode from './ColorSelectorNode'; @@ -137,9 +137,8 @@ const CustomNodeFlow = () => { ]); }, []); - const onConnect = useCallback( - (connection: Connection) => - setEdges((eds) => addEdge({ ...connection, animated: true, style: { stroke: '#fff' } }, eds)), + const onConnect: OnConnect = useCallback( + (connection) => setEdges((eds) => addEdge({ ...connection, animated: true, style: { stroke: '#fff' } }, eds)), [setEdges] ); diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 2dd4e593..70a3de11 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,19 +1,28 @@ # @xyflow/react +## 12.0.0-next.8 + +### Patch changes + +- fix `OnNodeDrag` type + ## 12.0.0-next.7 ## Minor changes -- pass Node/Edge types to changes thanks @FelipeEmos -- use position instead of positionAbsolute for `getNodesBounds` - add second option param to `screenToFlowPosition` for configuring if `snapToGrid` should be used + +### Patch changes + +- pass `Node`/ `Edge` types to changes thanks @FelipeEmos +- use position instead of positionAbsolute for `getNodesBounds` - infer types for `getIncomers`, `getOutgoers`, `updateEdge`, `addEdge` and `getConnectedEdges` thanks @joeyballentine - refactor handles: prefix with flow id for handling nested flows - add comments for types like `ReactFlowProps` or `Node` for a better developer experience ## 12.0.0-next.6 -### Minor changes +### Patch changes - fix `deleteElements` - refactor internal `applyChanges`