搭建Typescript+React项目模板(1) --- 项目
2019-06-13 本文已影响0人
前端的爬行之旅
搭建项目
利用react官方提供的 create-react-app创建react+typescript的项目
npx create-react-app new-web --typescript
项目结构
生成的项目结构如下:

在开发app的过程中,我们只需关心src目录下的文件即可。
其中 src/index.js 是app的入口文件。
运行项目
$ cd new-web
$ npm start
运行成功显示如下:

浏览器访问:http://localhost:3000