refactor(examples): rename Advanced to CustomNodes, use func component

This commit is contained in:
moklick
2019-10-22 22:37:05 +02:00
parent bd60ad0ecd
commit 02005917f8
14 changed files with 2291 additions and 285 deletions
+19
View File
@@ -0,0 +1,19 @@
import React from 'react';
import { Handle } from 'react-flow';
export default({ data, styles }) => (
<div
style={{ background: '#FFCC00', padding: 10, borderRadius: 2, ...styles }}
>
<Handle type="target" position="left" style={{ background: '#999' }} />
<div>{data.input}</div>
<input onChange={(e) => data.onChange(e.target.value, data)} />
<Handle
type="source"
position="right"
style={{ background: '#999' }}
isValidConnection={connection => +connection.target % 2 === 0}
/>
</div>
);