state

Why does React state need a new object/array?

Why does React state need a new object/array?

  • May 25, 2021

If you have been using React for a while, you are familiar with how state update works. There are a lot of internal optimizations that React makes for faster rendering. One of the implementation details of the React internals is that it checks whether the given state object has actually...