update useNodeConnections
This commit is contained in:
@@ -12,7 +12,7 @@ function CustomHandle({ nodeId, ...handleProps }: HandleProps & { nodeId: string
|
||||
[nodeId]
|
||||
);
|
||||
const connections = useNodeConnections({
|
||||
type: handleProps.type,
|
||||
handleType: handleProps.type,
|
||||
handleId: handleProps.id,
|
||||
onConnect,
|
||||
onDisconnect,
|
||||
|
||||
@@ -15,7 +15,7 @@ function CustomHandle({ nodeId, ...handleProps }: HandleProps & { nodeId: string
|
||||
[nodeId]
|
||||
);
|
||||
const connections = useNodeConnections({
|
||||
type: handleProps.type,
|
||||
handleType: handleProps.type,
|
||||
handleId: handleProps.id,
|
||||
onConnect,
|
||||
onDisconnect,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { isTextNode, type MyNode } from '.';
|
||||
|
||||
function ResultNode() {
|
||||
const connections = useNodeConnections({
|
||||
type: 'target',
|
||||
handleType: 'target',
|
||||
});
|
||||
const nodesData = useNodesData<MyNode>(connections.map((connection) => connection.source));
|
||||
const textNodes = nodesData.filter(isTextNode);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { isTextNode, type TextNode, type MyNode } from '.';
|
||||
function UppercaseNode({ id }: NodeProps) {
|
||||
const { updateNodeData } = useReactFlow();
|
||||
const connections = useNodeConnections({
|
||||
type: 'target',
|
||||
handleType: 'target',
|
||||
});
|
||||
const nodesData = useNodesData<MyNode>(connections[0]?.source);
|
||||
const textNode = isTextNode(nodesData) ? nodesData : null;
|
||||
|
||||
Reference in New Issue
Block a user