MobX Mutability vs Immutability MobX Mutability vs Immutability reactjs reactjs

MobX Mutability vs Immutability


it really depends on what you do. MobX doesn't use immutable concept, in fact, I don't think it's wise to immutable data in MobX. For example, if you add an item to an observable array, if you do it immutable way, the whole array will re-render. If you just simply push the item into the array, only the added item will render. There may be cases that you need to return a new array instead of mutating it, but in most cases, MobX should not use immutable way to update observable data.