Counter.propTypes = { number: PropTypes.number, color: PropTypes.string, onIncrement: PropTypes.func, onDecrement: PropTypes.func, onSetColor: PropTypes.func};위부분에서 발생한 에러인데 Counter.PropTypes를 Counter.propTypes로 수정하니 해결
자식컴포넌트를 import할때 import plus from './plus';위처럼 해서 위와같이 할경우 에러 발생 import Plus from './plus'; 위와 같이 해야 정상 동작
데이터를 받을때 그데이터의 타입이 잘못된것인지 확인할 필요가있다 import PropTypes from 'prop-types' class Movie extends Component { static propTypes = { title: PropTypes.string.isRequired, // PropTypes가 기본으로 있는 타입이아니라서 에러가남 타입을 check를 함 데이터통신하다 이상한 타입이들어올수있으니 poster: PropTypes.string }; render(){ // html을 리턴해주는놈 return( {this.props.title} ); }} propTypes를 이용하여 받을 데이터의 타입을 지정해줄수있다 string이 아닌 다른 데이터타입이 오면 에러가 발생 isRequired를 붙..
npm install -g create-react-app 을 쳐서 설치하려할때 npm WARN npm npm does not support Node.js v10.15.3 등 설치가 되지않아 create-react-app helloworld를 쳤을때 인식하지 못할경우 npm을 제거후 다시 설치 Mac: sudo npm uninstall -g npm Windows: npm uninstall -g npm 위 코드 실행후 다시 npm install -g create-react-app 설치