diff --git a/packages/react/src/hooks/useHandleConnections.ts b/packages/react/src/hooks/useHandleConnections.ts index 20b65a2d..6d82403c 100644 --- a/packages/react/src/hooks/useHandleConnections.ts +++ b/packages/react/src/hooks/useHandleConnections.ts @@ -22,6 +22,7 @@ type useHandleConnectionsParams = { * Hook to check if a is connected to another and get the connections. * * @public + * @deprecated Use `useNodeConnections` instead. * @param param.type - handle type 'source' or 'target' * @param param.nodeId - node id - if not provided, the node id from the NodeIdContext is used * @param param.id - the handle id (this is only needed if the node has multiple handles of the same type) @@ -36,6 +37,10 @@ export function useHandleConnections({ onConnect, onDisconnect, }: useHandleConnectionsParams): HandleConnection[] { + console.warn( + '[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections' + ); + const _nodeId = useNodeId(); const currentNodeId = nodeId ?? _nodeId; diff --git a/packages/svelte/src/lib/hooks/useHandleConnections.ts b/packages/svelte/src/lib/hooks/useHandleConnections.ts index 7aec3858..be331d8a 100644 --- a/packages/svelte/src/lib/hooks/useHandleConnections.ts +++ b/packages/svelte/src/lib/hooks/useHandleConnections.ts @@ -16,6 +16,7 @@ const initialConnections: HandleConnection[] = []; * Hook to check if a is connected to another and get the connections. * * @public + * @deprecated Use `useNodeConnections` instead. * @param param.nodeId * @param param.type - handle type 'source' or 'target' * @param param.id - the handle id (this is only needed if the node has multiple handles of the same type) @@ -24,6 +25,10 @@ const initialConnections: HandleConnection[] = []; export function useHandleConnections({ type, nodeId, id = null }: useHandleConnectionsParams) { const { edges, connectionLookup } = useStore(); + console.warn( + '[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://svelteflow.dev/api-reference/hooks/useNodeConnections' + ); + const _nodeId = getContext('svelteflow__node_id'); const currentNodeId = nodeId ?? _nodeId;