Getting Started -> Building a Flow -> Adding an Edge: add label and define type of the edges

master
Jason Zhu 2023-05-29 19:47:01 +10:00
parent 2a52c5ae40
commit d93dcdb398
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,9 @@ 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 edges = [
{ id: '1-2', source: '1', target: '2', label: 'to the', type: 'step' },
];
const nodes = [ const nodes = [
{ {