그냥 npm이나 yarn으로 모듈 추가했는데

typescript가 모듈을 못읽어 온다.

분명히 yarn add react-router-dom을 했는데!!!

typescript프로젝트에서는 @types에 모듈이 있어야 한다.

yarn add @types/react-router-dom


차분히 하나씩 해야 했는데 create-react-app으로 ts프로젝트 바로 만들어서 건너뛴게 화근!!

shift+cmd+p 로 명령 팔레트를 열고

shell commad를 입력하면 install code path 라는 항목이 뜬다.

골라서 설치하면 원하는 디렉터리에서 vs code를 열 수 있다.

.code 

create-react-app typescript-react-tutorial --scripts-version=react-scripts-ts

'FrontEnd > react' 카테고리의 다른 글

react-data-grid  (0) 2018.06.23
react-data-grid 정리#1 table cell word-wrap 문제  (0) 2018.05.29
react autofocus  (0) 2018.04.26
component, route, children  (0) 2018.04.17
표현 컴포넌트와 컨테이너 컴포넌트  (0) 2018.04.15

+ Recent posts