运行代码
前提:node环境
构建命令:安装组件(如下)+创建应用程序+启动运行
npm install
npm create-react-app app-name --scripts-version=react-scripts-ts
npm start
然后就自动启动默认浏览器,项目运行在http://localhost:3000/端口
react默认情况下不使用typescript,react-scripts-ts 可以理解为一个插件, 在标准的 create-react-app 项目管道中引入 TypeScript.