-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Error when removing nodes #10
Comments
I could replicate a similar issue, but I am not totally sure whether it is the same as the one you experienced. I've pushed a fix with the version v1.1.3, can you please update the dependency on your side and report back to me if the issue persists? Thank you. |
it seems that the latest version fixes this issue. i am glad to see that the issue was not on the custom remove algorithm i have been implementing :D is there an "official" way to implement node removal? would be nice to have it in the doc |
Happy that it solved your problem :) The library focuses on rendering the tree, managing the lifecycle of the tree data is something I would rather not move into the library focus due to not make it too broad. |
i do agree, but maybe suggesting canonical ways to do that in a separate section of the documentation could be helpful, since i assume that node removal is also a common operation. if you need to, you can take my code snippet above as a starter, but i cannot guarantee that t will work for all situations. will let you close this issue. |
I understand that you might prefer guides on specific topics like that, but one of the benefits of this library is that it does not make any assumptions on anything not related to rendering the tree. There are lots of ways of doing this, there also exist libraries for this (e.g. npm: tree-util or data-tree). And from my experience, documentation can become stale very quickly with changing code, especially for smaller projects that are not backed by big communities, which is why I don't want to add anything for this. But I think this issue will definitely be a good starting point for others that have similar problems, with your code as example for a custom implementation or by using one of these libraries: |
Describe the bug
I have implemented the following recursive routine to remove nodes and nested children.
The routine above seems to work by looking at the console.log(), but when i set the state with the new reduced tree i get the following error:
The text was updated successfully, but these errors were encountered: