Skip to content

How to create tree with 1+n roots? #48

Open
@Frit

Description

@Frit

tree field is waiting for object
e.g.
state = { tree: { "module": "first-root", "children": [somechildren] } }
but what if I need 1+n roots?
I've tried to create tree without first module >
state = { tree: {"children": [somechildren] } }
and in the renderNode function added
if (!node.module) { return null; }
renders fine, but now draggable element has padding(shifted), because root doesn't contain node.
Need structure example:
state = { tree: [ { "module": "first-root", "children": [somechildren]}, { "module": "second-root", "children":[somechildren]}, etc. ]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions