Every time in react
I care about immutable array operations
to avoid accidental state changes via mutable operations
I often use immutable operations
whenever I need to add a new item I use this
[...myArr, 'newItem'];
instead of mutable oprations
myArr.push('newItem');
However, I saw an example of mobx
on the official doc, And I was surprised because they use push()
method.
I am a beginner in mobx
, and I am afraid to use mutable operation
,
Does anyone have an idea about it?
am I doing wrong or Can I go with a mutable
operation on mobx
with react?