deprecated useHandleConnections
This commit is contained in:
@@ -22,6 +22,7 @@ type useHandleConnectionsParams = {
|
|||||||
* Hook to check if a <Handle /> is connected to another <Handle /> and get the connections.
|
* Hook to check if a <Handle /> is connected to another <Handle /> and get the connections.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
|
* @deprecated Use `useNodeConnections` instead.
|
||||||
* @param param.type - handle type 'source' or 'target'
|
* @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.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)
|
* @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,
|
onConnect,
|
||||||
onDisconnect,
|
onDisconnect,
|
||||||
}: useHandleConnectionsParams): HandleConnection[] {
|
}: useHandleConnectionsParams): HandleConnection[] {
|
||||||
|
console.warn(
|
||||||
|
'[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections'
|
||||||
|
);
|
||||||
|
|
||||||
const _nodeId = useNodeId();
|
const _nodeId = useNodeId();
|
||||||
const currentNodeId = nodeId ?? _nodeId;
|
const currentNodeId = nodeId ?? _nodeId;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const initialConnections: HandleConnection[] = [];
|
|||||||
* Hook to check if a <Handle /> is connected to another <Handle /> and get the connections.
|
* Hook to check if a <Handle /> is connected to another <Handle /> and get the connections.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
|
* @deprecated Use `useNodeConnections` instead.
|
||||||
* @param param.nodeId
|
* @param param.nodeId
|
||||||
* @param param.type - handle type 'source' or 'target'
|
* @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)
|
* @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) {
|
export function useHandleConnections({ type, nodeId, id = null }: useHandleConnectionsParams) {
|
||||||
const { edges, connectionLookup } = useStore();
|
const { edges, connectionLookup } = useStore();
|
||||||
|
|
||||||
|
console.warn(
|
||||||
|
'[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://svelteflow.dev/api-reference/hooks/useNodeConnections'
|
||||||
|
);
|
||||||
|
|
||||||
const _nodeId = getContext<string>('svelteflow__node_id');
|
const _nodeId = getContext<string>('svelteflow__node_id');
|
||||||
const currentNodeId = nodeId ?? _nodeId;
|
const currentNodeId = nodeId ?? _nodeId;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user