Hello World...
[두잇!]리액트 프로그래밍 정석 131p 3분 코딩 에러 해결 본문
책 131페이지 3분 코딩 부분을 입력해보니 타입에러가 나면서 정상적으로 작동하지 않았다.
내 node 버전은 12이고 책의 버전은 10인데 달라서 그런 것일까??
콘솔 에러를 보니
<React.StrictMode>
<App />
</React.StrictMode>
스트릭트 모드여서 에러가 나나 싶어서 <React.StrictMode> 부분을 지웠지만 여전히 동일한 에러가 발생했다.
그래서 그냥 render 를 추가해주니 해결되었다.
class MyComponent extends React.Component {
componentDidUpdate() {
console.log('MyComponent 새로 고침');
}
render() {
return <h1>MyComponent</h1>;
}
}
'react.js' 카테고리의 다른 글
[react] react dev tools highlighting 기능 (v4 기준) (0) | 2020.04.30 |
---|---|
react proxy 리액트 프록시 cors 문제 해결 (0) | 2020.04.15 |
fetch 사용시 credentilas (0) | 2020.04.08 |
html input tag type "datetime-local" 날짜와 시간 (0) | 2020.02.01 |
recast.ly 에서 ref 활용 (0) | 2020.01.28 |
Comments