fix(handle-on-connect): use correct HandleConnection type #5447

This commit is contained in:
moklick
2025-08-12 14:36:06 +02:00
parent 91e5e302d5
commit 4e588b2c23
6 changed files with 18 additions and 15 deletions

View File

@@ -1,11 +1,11 @@
import { useEffect, useMemo, useRef } from 'react';
import {
Connection,
NodeConnection,
HandleType,
areConnectionMapsEqual,
handleConnectionChange,
errorMessages,
handleConnectionChange,
type NodeConnection,
type HandleType,
type HandleConnection,
} from '@xyflow/system';
import { useStore } from './useStore';
@@ -21,9 +21,9 @@ type UseNodeConnectionsParams = {
/** Filter by handle id (this is only needed if the node has multiple handles of the same type). */
handleId?: string;
/** Gets called when a connection is established. */
onConnect?: (connections: Connection[]) => void;
onConnect?: (connections: HandleConnection[]) => void;
/** Gets called when a connection is removed. */
onDisconnect?: (connections: Connection[]) => void;
onDisconnect?: (connections: HandleConnection[]) => void;
};
/**

View File

@@ -112,6 +112,7 @@ export {
type SetCenter,
type SetViewport,
type FitBounds,
type HandleConnection,
} from '@xyflow/system';
// we need this workaround to prevent a duplicate identifier error