[21-01-16 TIL] CRA에서 typescript 적용한 프로젝트 생성 방법

O2o2✨·2021년 1월 16일
0

TIL

목록 보기
3/25

create-react-app에서 typescript 적용한 프로젝트를 생성하는 방법


💫 문제

npx create-react-app [파일이름] --typescript
인터넷 글에 이렇게 써있었는데 TS 설치가 안 됐다

yarn add typescirpt
npm i --save-dev @types/react

하면 ts, tsx파일을 사용할 수 있다. 그런데 기존 파일(App.js, index.js)은 tsx로 안 바뀐다.


😮 해결

공식사이트에는 이렇게 써있었다.
npx create-react-app my-app --template typescript


참고 : Adding TypeScript | Create React App

profile
리액트 프론트엔드 개발자입니다.

0개의 댓글