refactor(react): shorter useHandleConnections params
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { memo, useEffect } from 'react';
|
||||
import { memo } from 'react';
|
||||
import { Handle, Position, useHandleConnections, useNodesData } from '@xyflow/react';
|
||||
|
||||
function ResultNode() {
|
||||
const connections = useHandleConnections({
|
||||
handleType: 'target',
|
||||
type: 'target',
|
||||
});
|
||||
const nodesData = useNodesData(connections.map((connection) => connection.source));
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Position, NodeProps, useUpdateNodeData, Handle, useHandleConnections, u
|
||||
|
||||
function UppercaseNode({ id }: NodeProps) {
|
||||
const connections = useHandleConnections({
|
||||
handleType: 'target',
|
||||
type: 'target',
|
||||
});
|
||||
const nodeData = useNodesData(connections[0]?.source);
|
||||
const updateNodeData = useUpdateNodeData();
|
||||
|
||||
Reference in New Issue
Block a user