minop1205 / react-dnd-treeview

A draggable / droppable React-based treeview component. You can use render props to create each node freely.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add multiple new node at once.

nilesh2b opened this issue · comments

@minop1205 I have been using this package from very long time and found very useful.

Can we add multiple nodes using dropdown list of nodes which will come from an API in the popup box of add new node?

@nilesh2b
Yes, it is possible.
No special method is needed, it should be possible by simply passing a new array to the tree property.

How you merge tree items is up to your application.

const newItems = [...oldItems, ...newItems];

<Tree tree={newItems} {. .otherProps} /> 

@minop1205 Thanks again. I will apply this method and check.