[React] Cannot read properties of null (reading 'useRef') TypeError: Cannot read properties of null (reading 'useRef') at Object.useRef

bin·2023년 5월 18일
0

Cannot read properties of null (reading 'useRef')
TypeError: Cannot read properties of null (reading 'useRef')
at Object.useRef

useRef를 쓰지도 않았는데 위와 같은 에러가 발생해서 당황했었습니다. 혹시나 과거의 내가 썼나 싶어 일일이 다 확인 해봤는데 없었는데

곰곰이 생각해 보니 전에도 어떤 에러로 끙끙 앓았는데 그때 버전을 바꿨더니 정상적으로 되었던 경험이 떠올라 package에 들어가 보니 react-router-dom을 빼먹은 것입니다. 

설치하니 정상적으로 출력되었습니다. 하마터면 며칠 걸릴 뻔..
profile
프론트엔드부터 공부하고 있습니다

0개의 댓글