React
Lifecycle Methods to Class
heeyeonjeong
2020. 11. 5. 19:21
반응형
mounting
- 처음으로 DOM에 rendering될 때
componentDidMount( )
unmounting
- 생성된 DOM이 제거 될 때
componentWillUnmount( )
the component Lifecycle
(자주 사용되는 Lifecycle위주로 작성됨)
Mounting - 구성 요소의 instance를 만들고 DOM에 삽일 할 때 아래 순서로 호출
constructor( )
render( )
componentDidMount( )
Updating - props, state의 변경으로 인행 발생. 해당 메서드는 구성 요소가 다시 rendering될 때 아래 순서로 호출
render( )
componentDidUpdate( )
Unmounting - 구성 요소가 DOM에서 제거 될 때 호출
componentWillUnmount( )
React.Component – React
A JavaScript library for building user interfaces
reactjs.org