-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.jsx
40 lines (37 loc) · 940 Bytes
/
test.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React, { memo } from 'react';
import { Handle } from 'react-flow-renderer';
React;
const isValidSourceConnection = (connection) => {
console.log(connection);
return true
};
const isValidDestConnection = (connection) => {
console.log(connection);
return true
};
export default memo(({ data, isConnectable }) => {
return (
<div className="testNode">
<Handle
type="target"
position="left"
data={data}
style = { { background: '#blue' } }
isValidConnection ={isValidSourceConnection}
onConnect={(params) => console.log('handle onConnect', params)}
isConnectable={isConnectable}
/>
<div>
Test
</div>
<Handle
type="source"
position="right"
id="b"
isValidConnection ={isValidDestConnection}
style={{ background: '#555' }}
isConnectable={isConnectable}
/>
</div>
);
});