[React]TypeScript로 시작하기

KwonSungMin·2023년 9월 6일

React

목록 보기
3/8

새로시작하기

npx create-react-app my-app --template typescript

위 코드는 자체적으로 실행시켜준다.

기존프로젝트에 시작하기

기존 Create React App 프로젝트에 TypeScript를 추가하려면 먼저

npm install --save typescript @types/node @types/react @types/react-dom @types/jest

다음으로 파일 이름을 TypeScript 파일로 바꾸고(예 src/index.jssrc/index.tsx개발 서버를 다시 시작합니다 !

profile
제가 다시 보기 위해 작성합니다:)

0개의 댓글