There is a concept in React that state is immutable. This doesn’t mean state can’t be changed. It just means we don’t mutate state directly. We do it with outside functions and copies. The rule of thumb in React is to modify state via a setState function rather than mutate state directly.

Related Articles