4 ms·
no, because it is not immutable. in react directly mutating objects and arrays does not trigger rerenders.
by joshxyz 3y ago
no, because it is not immutable.
in react directly mutating objects and arrays does not trigger rerenders.
- JSLegendDev 3y agoI should have probably specified the context but the code example I shared is not coming from a perspective of using React. I think with React the way to handle state is dictated by the library so there isn't much choice you have to make. You basically have to follow whatever pattern React gives you.