@xyflow/react
Version:
React Flow - A highly customizable React library for building node-based editors and interactive flow charts.
25 lines • 787 B
TypeScript
import { type NodeConnection, type UseNodeConnectionsParams } from '@xyflow/system';
/**
* This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID.
*
* @public
* @returns An array with connections.
*
* @example
* ```jsx
*import { useNodeConnections } from '@xyflow/react';
*
*export default function () {
* const connections = useNodeConnections({
* handleType: 'target',
* handleId: 'my-handle',
* });
*
* return (
* <div>There are currently {connections.length} incoming connections!</div>
* );
*}
*```
*/
export declare function useNodeConnections({ id, handleType, handleId, onConnect, onDisconnect, }?: UseNodeConnectionsParams): NodeConnection[];
//# sourceMappingURL=useNodeConnections.d.ts.map