본문 바로가기
TIL/REACT

리액트 라이프 사이클

by koreashowme 2019. 10. 11.

클래스의 경우

(client.js로 부터 렌더링 되는 순간) <ReactDom.render>

 

==> constructor ==> render ==> ref ==> componentDidMount (컴포넌트가 첫 렌더링 된 경우)

 

==> (setState/props 바뀔 때) ==> shouldComponentUpdate(true)

(if return ture, 렌더링을 시킴. false면 일어나지 않음.)

 

==> (re)render ==>  componentDidUpdate (리렌더링 후)

 

==> 부모가 나를 없앴을 때 ==> componentWillUnmount(컴포넌트 제거되기 직전)

 

==> 소멸

comment