Getting Started -> Building a Flow -> Adding an Edge: connect them with a curly edge
parent
eb4286d453
commit
2a52c5ae40
|
@ -3,6 +3,8 @@ import ReactFlow, { Background, Controls } from 'reactflow';
|
||||||
// we have to import the React Flow styles for it to work
|
// we have to import the React Flow styles for it to work
|
||||||
import 'reactflow/dist/style.css';
|
import 'reactflow/dist/style.css';
|
||||||
|
|
||||||
|
const edges = [{ id: '1-2', source: '1', target: '2' }];
|
||||||
|
|
||||||
const nodes = [
|
const nodes = [
|
||||||
{
|
{
|
||||||
id: '1',
|
id: '1',
|
||||||
|
@ -20,7 +22,7 @@ const nodes = [
|
||||||
const Flow = () => {
|
const Flow = () => {
|
||||||
return (
|
return (
|
||||||
<div style={{ height: '100vh' }}>
|
<div style={{ height: '100vh' }}>
|
||||||
<ReactFlow nodes={nodes}>
|
<ReactFlow nodes={nodes} edges={edges}>
|
||||||
<Background />
|
<Background />
|
||||||
<Controls />
|
<Controls />
|
||||||
</ReactFlow>
|
</ReactFlow>
|
||||||
|
|
Loading…
Reference in New Issue