React/Basic

React - Component LifeCycle

고코모옹 2021. 6. 3. 22:57

https://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/

 

React Lifecycle Methods diagram

Fully interactive and accessible React Lifecycle Methods diagram.

projects.wojtekmaj.pl

 

  • 자주 사용되는 생명주기 메소드
    • Mount - 컴포넌트의 인스턴스가 생성되어 DOM 상에 삽입
      1. constructor()
      2. render() - 최초 렌더
      3. componentDidMount()
    • Update - Props 또는 State가 변경되면 Update 발생(re-rendering)
      1. render()
      2. componentDidUpdate()
    • Unmount - 컴포넌트가 DOM 상에서 제거될 때 호출
      1. componentWillUnmount()

 

https://ko.reactjs.org/docs/react-component.html

 

React.Component – React

A JavaScript library for building user interfaces

ko.reactjs.org