React uses immutability for obvious performance reasons. for instance
The idea is when you set the state, you do not mutate the state, but clone part of it, and then update the state
for instance
this.state = { entries: [1,2,3] }
you have to do
this.state.setState({ entries: this.state.entries.slice().push(9); //not this.state.entries.push(9) })
Performance gains are achieved when you use shouldComponentUpdate
in shouldComponentUpdate you can just compare the links and not do a deep check
shouldComponentUpdate(prevState,newState){ return prevState.entries != newState.entries }
source share