
타입스크립트+리액트의 셋팅방법은 총 3가지가 있다.
1번 빌드도구(ex. vite) 사용
2번 수동적 방법
3번 보일러플레이트 (반자동)의 방법으로 세팅
1번 각각의 빌드도구의 세팅방법은 각각마다 다르니
2번, 3번에 대해 설명하겠다!
npx create-react-app .
npm i @types/node typescript @types/react @types/react-dom
tsc --init
자세한 빌드 세팅은 여기서!
npx create-react-app . --template typescript
npx create-react-app . --template=typescript
둘중에 하나만 하면 끝!
위에 방법에서 하나씩 설정해주다가 이런 편리한 방법을 찾다니...
npm i styled-components
npm i @types/styled-components -D
npm i styled-components @types/styled-components -D
npm i react-router-dom
npm i @types/react-router-dom -D : 있었는데 24년초에 6이 나오면서 자동 타입정의가 가능
npm i @tanstack/react-query
npm i recoil
npm i react-hook-form