2015년 3월 24일 화요일

[ReactJS] 라이프사이클

reactjs에서 제공하는 라이프사이클에 대한 호출 순서를 알아보기 테스트를 해보았다.

첫render 순서 : getInitialState -> componentWillMount -> render ->componentDidMount

props 변경 순서 : componentWillReceiveProps -> shouldComponentUpdate -> componentWillUpdate -> render -> componentDidUpdate -> setProps

state 변경 순서 :  setState -> shouldComponentUpdate -> componentWillUpdate -> render -> componentDidUpdate

위 테스트 코드는 밑에와 같다.

댓글 없음:

댓글 쓰기