react入门之使用 create-react-app 快速构建 React 开发环境

版权声明:转载请注明出处 https://blog.csdn.net/weixin_43586120/article/details/90036179

create-react-app来自于 Facebook,通过该命令我们无需配置就能快速构建 React 开发环境。

create-react-app 自动创建的项目是基于 Webpack + ES6 。

用create-react-app脚手架搭建react项目的2种方式:

//第1种
npx create-react-app myApp

//第2种
npm install -g create-react-app
create-react-app myApp
cd myApp
npm start

my-app/项目目录 

    README.md

    node_modules/

    package.json

    .gitignore

    public/

        favicon.ico、index.html、manifest.json

    src/

        App.css、App.js、App.test.js、index.css、index.js、logo.svg

说明 : manifest.json 指定了开始页面 index.html,一切的开始都从这里开始,所以这个是代码执行的源头

可以尝试修改 src/App.js 文件代码,会发现代码保存后自动刷新。

猜你喜欢

转载自blog.csdn.net/weixin_43586120/article/details/90036179
今日推荐