加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

React开发环境准备

发布时间:2020-12-15 09:28:59 所属栏目:百科 来源:网络整理
导读:react fiber 指react 16以上的版本 ? 引入react的方式 : 1、引入.js文件 2、使用脚手架工具(推荐) ? 推荐使用react官方提供的脚手架工具:create-react-app ? React开发环境准备 (npx 是 npm 的高级版本,npx 具有更强大的功能) npx create-react-app m

react fiber 指react 16以上的版本

?

引入react的方式

1、引入.js文件

2、使用脚手架工具(推荐)

?

推荐使用react官方提供的脚手架工具:create-react-app

?

React开发环境准备

(npx 是 npm 的高级版本,npx 具有更强大的功能)

npx create-react-app my-app
cd my-app
npm start

?

npx create-react-app 使用淘宝镜像

1、查看npm的镜像源

npm config get registry

// 默认是:https://registry.npmjs.org/

?

?

2、修改成淘宝的镜像源

npm config set registry https://registry.npm.taobao.org

?

?

3、create-react-app创建项目

npx create-react-app myapp

?

最后的运行结果

?

?

浏览器访问:

?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读