잊기

[React] Error Code 본문

React !

[React] Error Code

잊기 2023. 3. 15. 17:09

<Module>

Module not found: Error: Can't resolve 'axios' in '경로'

-> 'axios' 모듈을 찾을 수 없음

해결 : npm install module

-> 'react-router-dom' 모듈을 찾을 수 없음

해결 : npm i -s react-router-dom

 

< map, onClick >

Expected an assignment or function call and instead saw an expression no-unused-expressions

 

-> 다수의 함수를 넣고 잘 묶어주지 않아뜸..

해결 : 1. 요소를 { } 가 아닌 ( ) 로 묶음 

          2. {  return ( A함수( ), B함수( ) )  }기재

{ } 를 ( ) 로 바꿔 해결

 

 

Warning: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.

-> checked랑 onClick 같이 사용 불가,

해결 : 1. checked 대신 defaultChecked 사용 v

          2. onClick 대신 onChange 사용

       

온갖 에러가 났던 뤠디오버튼 ㅅㅂ

라이브러리 인스톨시 ERR!! 

-> dependency : 가 붙어있는 ERR 는  버전호환문제

해결 : 끝에 --f를 붙여서 다시 인스톨

 

npm run start 실행시 오류

-> 새로 받은 project 등은 package.json 파일이 없음

해결 : npm install --f

-> 이번엔 build가 없음..

해결 : npm run build