Closed Vadorequest closed 3 years ago
Ya - the code is meant to be more of psuedo code but I will fix it to be more clear.
I think adding some comment above the function like "coming from useState
or similar would be enough.
Or add a more complete example such as:
const [nodes, setNodes] = useState<NodeData[]>([
{
id: '2',
text: 'Mother',
data: {
gender: 'female',
},
},
{
id: '3',
text: 'Daughter',
data: {
gender: 'female',
},
},
{
id: '4',
text: 'Son',
data: {
gender: 'male',
},
},
]);
const [edges, setEdges] = useState<EdgeData[]>([
{
id: '2-3',
from: '2',
to: '3',
},
{
id: '2-4',
from: '2',
to: '4',
},
]);
Care to make a PR to add this?
Documentation updated in https://github.com/reaviz/reaflow/pull/72
https://reaflow.dev/?path=/story/docs-getting-started-linking-nodes--page
Uses a
setEdges
function which isn't defined anywhere.