React
-
Typescript로 React 시작하기React 2020. 12. 19. 20:29
새로운 리액트 앱 생성하기 프로젝트를 설치할 곳으로 이동하여 명령어 입력. 뒤에 입력하는 travelog 가 프로젝트 폴더의 이름이 된다. 타입스크립트 설정이 적용된 프로젝트가 생성된다. npx create-react-app travelog --template typescript 정상 설치가 되면 다음과 같은 run commands를 볼 수 있다. cd travelog npm start 해당 프로젝트 폴더로 이동하여 npm start 로 서버를 실행하면 http://localhost:3000 에서 실행된다. 자 이제 본격적으로 코드를 작성 시작! 에 앞서 파일이 너무 많아 안그래도 복잡해 죽겠는데 더 복잡한건 싫으니 필요없는 파일은 다 지워버린다ㅏ 유후! App.tsx index.tsx 빼곤 다 지워도 ..