react-arborist icon indicating copy to clipboard operation
react-arborist copied to clipboard

Create hook to react to all tree changes

Open downright-development opened this issue 7 months ago • 1 comments
trafficstars

I'd love to see a single hook to react to all tree changes.

Use case - I want the tree to handle add move delete rename internally, because quite frankly it's a PITA to manage, and a single hook where I can get the latest tree back. I'm store the entire tree as a single json document and it'd be far easier to just upsert the tree.

downright-development avatar Apr 06 '25 00:04 downright-development

Update - I ended up just implementing all of the handler functions and it's working well, I saw the 'effect' of what I wanted was capable if I used a simpleTree.. but I quickly outgrew that.

(i.e.,

const {treeItems, controller} = useSimpleTree(initialData);

It would still be nice to to expose a hook "onPresenceChange" or something that callers could react to

downright-development avatar Apr 09 '25 02:04 downright-development