mobxjs / mobx-state-tree

Full-featured reactive state management without the boilerplate
https://mobx-state-tree.js.org/
MIT License
6.94k stars 641 forks source link

What can I do with a node id returned from getNodeId? #1875

Closed JordanSalinas closed 2 years ago

JordanSalinas commented 2 years ago

What's the purpose of getNodeId? Currently I'm using it in React as a key when iterating lists and returning components. What I'd like to do is use it to modify data in the store. i.e. removeNode(nodeId). Is there a way to use it in this way? Honestly even if I could just do getNodeById(nodeId) that'd be useful as well because then I could just use the built in methods like destroy(node). I suppose I could just implement this myself, but I think having a getNodeById method would be a lot easier and cleaner.