使用脚手架搭建react项目

第一步:全局安装create-react-app

cnpm i -g create-react-app

第二步:创建项目

create-react-app my_react   my_react是项目名字

第三步:启动项目

cd my_react

cnpm start

 

使用准备

  删除src文件下的所有文件只保留index.js,并清空index.js的内容,最终保留如下图

   删除public文件下的所有文件只保留index.html ,manifest.json

扫描二维码关注公众号,回复: 10189672 查看本文章

猜你喜欢

转载自www.cnblogs.com/tlfe/p/12574221.html