react-dnd-treeview icon indicating copy to clipboard operation
react-dnd-treeview copied to clipboard

Add multiple new node at once.

Open nilesh2b opened this issue 2 years ago • 2 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 avatar Oct 11 '23 07:10 nilesh2b

@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 avatar Oct 11 '23 08:10 minop1205

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

nilesh2b avatar Oct 11 '23 09:10 nilesh2b