feat(handle): onConnect cb
This commit is contained in:
+13
-2
@@ -7,8 +7,19 @@ const SpecialNode = ({ data, styles }) => (
|
||||
<div
|
||||
style={{ background: '#FFCC00', padding: 10, borderRadius: 2, ...styles }}
|
||||
>
|
||||
<Handle type="target" position="top" id="a" style={{ left: 10, background: '#999' }} />
|
||||
<Handle type="target" position="top" id="b" style={{ left: 30, background: '#999' }} />
|
||||
<Handle
|
||||
type="target"
|
||||
position="top"
|
||||
id="a"
|
||||
style={{ left: 10, background: '#999' }}
|
||||
onConnect={params => console.log('handle onConnect', params)}
|
||||
/>
|
||||
<Handle
|
||||
type="target"
|
||||
position="top"
|
||||
id="b"
|
||||
style={{ left: 30, background: '#999' }}
|
||||
/>
|
||||
<div>I am <strong>special</strong>!<br />{data.label}</div>
|
||||
<select onChange={(e) => data.onChange(e.target.value, data)}>
|
||||
<option value="1">1</option>
|
||||
|
||||
Reference in New Issue
Block a user