React

less than 1 minute read

생명주기 메서드

  • componentWillMount
  • componentDidMount
  • componentWillUnmount
  • componentWillUpdate
  • componentDidUpdate
  • shouldComponentUpdate
    • if ~~~ return true else false
      true면 업데이트, false면 무시
  • componentWillReceiveProps
  • componentDidCatch

동작

초기 렌더링

  • 기본 속성 설정
  • 기본 상태 설정
  • componentWillMount
  • render
  • componentDidMount

상태변경

  • shouldComponentUpdate
  • componentWillUpdate
  • render
  • componentDidUpdate

속성변경

  • componentWillReceiveProps
  • shouldComponentUpdate
  • componentWillUpdate
  • render
  • componentDidUpdate

언마운트

  • componentWillUnmount

scaffold

npm i -g create-react-app
create-react-app hellowork-app

Redux, HOC