lukasbach / react-complex-tree

Unopinionated Accessible Tree Component with Multi-Select and Drag-And-Drop
https://rct.lukasbach.com
MIT License
944 stars 74 forks source link

feat: expose `depth` and `parentId` to `renderItemsContainer` #264

Closed paulrostorp closed 1 year ago

paulrostorp commented 1 year ago

This PR forwards the parentId prop and depth prop to renderItemsContainer.

My use case is that I need to render a text input at each level of the tree to allow creating values at that level. Having access to the depth prop allows me to render the input component at the proper level of indentation. The parentId is needed so I know where to push the new item :)

Screenshot 2023-05-16 at 17 50 55

@lukasbach I cannot assign reviewers, but hopefully a mention is enough of a nudge 😄

lukasbach commented 1 year ago

Looks good, thanks for your contribution!