初学者可以通过 create-react-app 快速搭建 demo 入门,熟练者可以通过 create-react-app 分析源码和最新的特性。
所以本文简单介绍 create-react-app 的入门使用。
参考官网 create-react-app 的步骤:
npx create-react-app my-app
cd my-app
npm start
就可以启动本地服务,localhost:3000 就可以查看demo了。
看起来脚手架生成的代码还是很清爽的,

这个是demo的界面,

后续其他文章,我会在 create-react-app 的基础上对react新功能做些介绍。
总体上,create-react-app 还是很方便的,生成的代码该有的有,多余的代码例如打包什么的,都是透明的。
网友评论