当前位置: 移动技术网 > IT编程>开发语言>JavaScript > React开发环境准备及安装

React开发环境准备及安装

2020年04月12日  | 移动技术网IT编程  | 我要评论

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

 

最后的运行结果

 

 

浏览器访问:

 

 转自:https://www.cnblogs.com/chenyingying0/p/12685259.html

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网