styled component를 적용시킨 후, npm start를 했을 때 에러가 발생했다.
발생한 에러는 다음과 같다.
Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
찾아보니 이는 생각보다 쉽게 해결됐다.
바로 styled-component가 프로젝트 폴더가 아닌 곳에 설치되어 있어서 발생한 문제였다.
cd react-masterclass // 터미널에서 현재 위치를 프로젝트로 이동
npm i styled-components // styled-component 설치
npm start // 프로젝트 실행