Skip to content

Commit e32f357

Browse files
Merge pull request #112 from festim-dev/fix-integrator-inputs
Fix integrator connections limit
2 parents 78755af + e33b40b commit e32f357

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/IntegratorNode.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import React from 'react';
2-
import { Handle } from '@xyflow/react';
1+
import { Handle, useNodeConnections } from '@xyflow/react';
2+
33

44
export default function IntegratorNode({ data }) {
5+
const connections = useNodeConnections({
6+
handleType: "target",
7+
});
8+
59
return (
610
<div
711
style={{
@@ -17,7 +21,7 @@ export default function IntegratorNode({ data }) {
1721
>
1822
<div style={{ marginBottom: 4 }}>{data.label}</div>
1923

20-
<Handle type="target" position="left" style={{ background: '#555' }} />
24+
<Handle type="target" position="left" style={{ background: '#555' }} isConnectable={connections.length < 1}/>
2125
<Handle type="source" position="right" style={{ background: '#555' }} />
2226
</div>
2327
);

0 commit comments

Comments
 (0)