React state should be treated as immutable. From the React docs: … This means a manual state mutation may be overridden when setState is processed. If you declare a shouldComponentUpdate method, you can’t use a === equality check inside because the object reference will not change.
Is state immutable in react?
React state should be treated as immutable. From the React docs: … This means a manual state mutation may be overridden when setState is processed. If you declare a shouldComponentUpdate method, you can’t use a === equality check inside because the object reference will not change.
Which is immutable in react?
Immutable. js allows us to detect changes in JavaScript objects/arrays without resorting to the inefficiencies of deep equality checks, which in turn allows React to avoid expensive re-render operations when they are not required. This means Immutable. js performance tends to be good in most scenarios.