Merging dev into main #49
@@ -75,7 +75,9 @@ function addNode(nodeType: keyof typeof NodeTypes, position: XYPosition) {
|
|||||||
id: id,
|
id: id,
|
||||||
type: nodeType,
|
type: nodeType,
|
||||||
position,
|
position,
|
||||||
data: {...defaultData}
|
// Deep copy using JSON because thats how things work:
|
||||||
|
// Ref: https://developer.mozilla.org/en-US/docs/Glossary/Deep_copy
|
||||||
|
data: structuredClone(defaultData)
|
||||||
}
|
}
|
||||||
setNodes([...nodes, newNode]);
|
setNodes([...nodes, newNode]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user