일전에 React 초기 세팅에 적긴 했지만 메인으로 따로 빼 둔다.
- React App 생성 (Create-React-App) 명령어
- npx create-react-app 앱명칭 --template typescript
- tsconfig 수정
- target 항목을 es6로 변경
- lib 에 es6 추가
- app.tsx 코드 변경
......
function App() {.. 이 부분을 typescript 형태로 변경
const App: React.FC = () => {
- React.FC : React Function Component 로서, typescript 에서 사용할 type 를 정의해 둔것.
'FrontEnd > React' 카테고리의 다른 글
[With Typescript] 유의할점 정리 (0) | 2024.10.18 |
---|---|
[With TypeScript] 모듈 export, import (0) | 2024.10.18 |
Craco 모듈 설치 (0) | 2024.10.18 |
Recoil (atom, selector) (2) | 2024.10.14 |
[Hook] useParams (2) - querystring (useLocation, useSearchParams) (0) | 2024.10.14 |