우당탕탕 개발일기
[TypeScript] REACT + TypeScript 준비 본문
728x90
0. 타입스크립트 설치 및 개발환경 세팅
npm install -g typescript
npx create-react-app my-app --template typescript
https://www.kenrhee.com/blog/getting-started-with-typescript-with-react
1. 기초 세팅
- tsconfig.json 파일 생성 (명령어 `tsc --init`으로도 가능)
- 타입스크립트 사용에 필요한 패키지 설치
// react의 Typescipt 버전
npm install -D @types/react
// react-dom의 Typescipt 버전
npm install -D @types/react-dom
// .ts/.tsx확장자를 읽어들이는 로더
npm install -D ts-loader
https://memostack.tistory.com/281
여기까지 하면 npm start
했을 때 화면에 띄워지는 것까지 확인할 수 있다!
728x90