React Life Cycle

쥬랑·2020년 2월 24일

1. Mounting

DOM에 element가 올라간 상태

  • 사용 가능한 Method

    • constructor()
    • getDrivedStateFromProps()
    • render()
    • ComponentDIdMount() : cycle method
  • render() 메서드는 항상 호출 됨

  • 다른 메서드는 사용자에 따라 정의

2. Updating

Componet가 변경될 때

  • 사용 가능한 Method
    • getDrivedStateFromProps()
    • shouldComponentUpdate()
    • render()
    • getSnapShotBeforeUpdate()
    • ComponetDidUpdate() : cycle method

3. Unmounting

DOM에서 Component가 제거 될 때

  • 사용 가능한 Method
    • ComponetWillUnmount() : cycle method
profile
작가이고 싶은 프로그래머

0개의 댓글