feat(connection): add start and stop props closes #380

This commit is contained in:
moklick
2020-08-01 12:54:14 +02:00
parent 01271a1994
commit 5f91498d19
8 changed files with 105 additions and 11 deletions

View File

@@ -15,6 +15,10 @@ const isValidConnection = (connection) => connection.target === 'B';
const onLoad = (reactFlowInstance) => reactFlowInstance.fitView();
const onConnectStart = ({ nodeId, handleType }) => console.log('on connect start', { nodeId, handleType });
const onConnectStop = () => console.log('on connect stop');
const CustomInput = () => (
<>
<div>Only connectable with B</div>
@@ -47,6 +51,8 @@ const HorizontalFlow = () => {
onLoad={onLoad}
className="validationflow"
nodeTypes={nodeTypes}
onConnectStart={onConnectStart}
onConnectStop={onConnectStop}
/>
);
};