rete
rete copied to clipboard
addControl: Item has already been added to some node
I believe there is a bug in code here, causing exception when calling node.addControl
https://github.com/retejs/rete/blob/76605fda249796667a05d9a687b3c852f70b54a6/src/node.ts#L28-L29
as when not using typescript, Control
instance has parent
property qual to undefined
.
https://github.com/retejs/rete/blob/76605fda249796667a05d9a687b3c852f70b54a6/src/control.ts#L8
It's not a bug. Initially Control
has parent = null
. It seems that this control has already been added to some node, so you cannot add it again
There is no error. I got the same exception and my mistake was extending the class using
class CustomControl extends Rete.Component
instead of
class CustomControl extends Rete.Control
That's probably why you don't have the parent
property defined.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.