-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encountered two children with same key
#104
Comments
@alexkalinins hello, are you solved this problem? |
@andriy-kdp @alexkalinins I don't know if issue is still relevant for you but it looks like I have found a way to fix this. All you need is to change "NodesCanvas" to "NodesCanvas$1" in lines 7 and 89 in node_modules\beautiful-react-diagrams\esm\Diagram\Diagram.js |
@Belashab Are you sure this fixes it? I just tried and it doesn't seem to work. I'm having the same issue |
For some reason, addNode internal dispatch is called twice, so the schema ends with two identical nodes. |
Have the same issue by using NextJs |
addNode is definitely broken since dispatching seems wrong. Added 3 nodes got 5 at the end with duplicate ID errors. |
Same here - has anyone found a solution yet? Please kindly advise, thanks! |
I have the same issue. Does anyone solve this problem? |
Having the same Issue.. AddNode is adding two nodes at once.. |
Hello. First of all, very nice project! After following the demonstrations in the documentation in JavaScript, I decided to try using the library with TypeScript. In my project, it is possible to add nodes with a button. We implement the TS types in our own object (
CustomNode
andCustomSchema
that holdsCustomNode
instead ofNode
). We also use a custom renderer to display the nodes.The our
Node.id
value is generated with uuid to make sure it is unique. ThePort.id
value is based on the same uuid, like '<node.id>-output-1'. The function that is triggered when button is pressed to make a new node makes a new node object instance and adds it to schema usingaddNode()
method that we get fromuseSchema()
.When we make a first node with button, nothing bad happens, we can drag it around and it is still fine. When we add a second node, immediately we get this error:
After adding the second node, dragging any node around or trying to link them repeats the same error continuously (complaining about the key of the second node). The links do form though and the function of our program is unaffected, only slows down performance significantly. The order of creation also does not matter; the first one works fine.
I tried adding a uuid key to the outer-most div in our custom renderer, but that does not fix it (the screenshot is without the uuid in div). Thank you for your help.
The text was updated successfully, but these errors were encountered: