chore(examples): useUpdateNodeInterals handle position

This commit is contained in:
moklick
2021-04-30 17:23:03 +02:00
parent 5562106913
commit b1a0106f06
2 changed files with 35 additions and 6 deletions
@@ -9,9 +9,17 @@ const CustomNode: FC<NodeProps> = ({ data }) => {
() =>
Array.from({ length: data.handleCount }, (x, i) => {
const handleId = `handle-${i}`;
return <Handle key={handleId} type="source" position={Position.Right} id={handleId} style={{ top: 10 * i }} />;
return (
<Handle
key={handleId}
type="source"
position={Position.Right}
id={handleId}
style={{ top: 10 * i + data.handlePosition * 10 }}
/>
);
}),
[data.handleCount]
[data.handleCount, data.handlePosition]
);
return (