-
Notifications
You must be signed in to change notification settings - Fork 214
Dynamically added children #141
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Comments
Hello @mathgameapi can you post a link to a live example that shows this issue (such as on JsFiddle or CodePen)? You can modify the following working example: |
Same issue for me: |
Thanks so much for the examples @stephdep1973! I was able to confirm the behavior you are experiencing. The main reason this occurs is because With your examples, there are two main issues:
See the modified Scenario 1 example below which will render the changes: https://codesandbox.io/s/reactcheckboxtree-add-new-child-fs3he Version 2.0 of this component may mitigate the second issue, because it might do away with the entire tree flattening operation and thus always render whatever |
Thank you ! Yes I also tested changing the state of the component to "force" a rendering but it did not help in both cases. Anyway, cloning the |
When i add the children。
if children is empty, treeview will not show the new children.
if children has one or more children , it got Cannot read property 'isParent' of undefined
The text was updated successfully, but these errors were encountered: