mobx-state-tree.module.js?f7d3:2154 Uncaught Error: [mobx-state-tree] Cannot add an object to a state tree if it is already part of the same or another state tree.
I get this error just by filtering through another state:
const data = self.allData.slice(0, 20);
self.sliced = data
Anyone has any idea what's wrong?
A node cannot exist twice in the state tree. You could instead model your
sliced
data as an array ofreferences
and it should work as expected.Example