constructor 안에서 super() 꼭 사용해야한다.
//super() 가 불리지 않으면, this가 초기화 되지 않는다.
super(props)
Constructor안에서 this.props 접근하려면 사용해야 한다,
참고 블로그
https://medium.com/@umioh1109/react-es6-class-constructor%EC%97%90%EC%84%9C%EC%9D%98-super-9d53ba0611d9
'React' 카테고리의 다른 글
React 이벤트 변수명 (0) | 2020.02.06 |
---|---|
React hooks - useEffect (0) | 2020.02.06 |
Container Presenter Pattern (0) | 2019.11.24 |
Axios (0) | 2019.11.22 |
React에서 CSS 적용하기 (0) | 2019.11.21 |