Skip to content

Problem with adding new childrens to node without reseting the collapse state #512

@Kamilos1337

Description

@Kamilos1337

Thank you for taking the time to report an issue with react-d3-tree!

Feel free to delete any questions that do not apply.

Are you reporting a bug, or opening a feature request?

Reporting a bug

What is the actual behavior/output?

I used the example from a repo of a tree, i try to add a nodes on a click. When i add a tree all the nodes are collapsed (i set initialDepth to 1 beacuse i need it). So every time i append some childrens to node with setState it all refresh.

What is the behavior/output you expect?

I expect a method or a way to add some children to a node without reseting the whole tree. Or a way so i can define which nodes are collapsed and which are not, currently as i see it's not possible to open a nodes in "data" object

Can you consistently reproduce the issue/create a reproduction case (e.g. on https://codesandbox.io)?

If needed but it's simple example.

What version of react-d3-tree are you using?

latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions