매일 해내는 개발/Develog
[Develog] 리액트 + 타입스크립트 프로젝트 만들기
해야지
2023. 1. 18. 07:53
반응형
Adding TypeScript | Create React App
Note: this feature is available with react-scripts@2.1.0 and higher.
create-react-app.dev
CRA를 사용해 타입스크립트를 사용하는 리액트 프로젝트를 생성할 수 있다.
새로운 CRA 프로젝트 사용시
npx create-react-app my-app --template typescript
또는
yarn create react-app my-app --template typescript
기존 CRA 프로젝트에 타입스크립트 추가하고 싶을 경우
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
또는
yarn add typescript @types/node @types/react @types/react-dom @types/jest
반응형