[리액트]Cannot read properties of undefined 오류

진경·2022년 4월 27일
0

리액트

목록 보기
3/4

이 오류가 왜 나는지, 원하는 값을 왜 못들고 오는지 고민하다가 찾아봤다.

 const [detail,setDetail]=useState();
 const [detail,setDetail]=useState({});

useState에 값이 들어올 타입을 안적으면 에러가 난다는 것을 알게 되었다. 다음부터는 잘 적어줘야지...

https://github.com/Dojinkyung/coin_app

profile
프론트엔드 취준생입니다

0개의 댓글