불변객체(immutable)
객체이다수정가능한 객체로 관리했다면 상태값이 변경됐는지 알 수 있는 방법은 하위 모든 depth property를 모두 비교해야한다.
불변객체
로 관리 했다면 한번의 비교로 비교가 가능하다.
class Todos exteds. React.component {
state = { todos: {title: 'fix bug', priority: 'hight'} }
shouldComponentUpdate(nextProps, nextState){
prevState.todos !== nextState.todos
}
}