react-native-tree-multi-select icon indicating copy to clipboard operation
react-native-tree-multi-select copied to clipboard

[FEAT-REQ] Adding a callback to only receive the checked node

Open Astremy opened this issue 1 year ago • 0 comments

Hello! As stated in the other issue (https://github.com/JairajJangle/react-native-tree-multi-select/issues/81), I think it would be cool to have a way to receive only the selected node, if we want to handle things differently or to use the tree in another context than like options.

Currently, I'm using something like that:

function checkBox(current){
  let removed = save.filter((o) => current.indexOf(o) === -1);
  let added = current.filter((o) => save.indexOf(o) === -1);
  
  console.log(added);

  save = current;
}

which isn't too bad, but it's not very practical either. So I think it could be nice to get the checked/unchecked node directly in some way.

And maybe a way to get the full object (or a partial one) and not only the id, or a way to pass down more informations? Well, I feel like I will have to do another issue xD

Astremy avatar Oct 04 '24 08:10 Astremy