minop1205 / react-dnd-treeview

A draggable / droppable React-based treeview component. You can use render props to create each node freely.
MIT License
530 stars 71 forks source link

feat: new util `getParents` #168

Closed percy507 closed 1 year ago

percy507 commented 1 year ago

Use case: when enter a page, we want to auto expand the parent node of the last selected node, then the getParents util will be helpful to dig the parental nodes.

minop1205 commented 1 year ago

@percy507 Thank you for your cooperation!

This utility is helpful as I felt I needed it too. It looks like it would work well with the initialOpen API.

I'll merge it in as well, since I have no problems testing it.