react项目搭建

时间:2022-07-22
本文章向大家介绍react项目搭建,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1.全局安装脚手架

npm install -g create-react-app

2、创建项目,安装依赖

create-react-app my-react-app

3、进入项目

cd my-react-app

4、启动项目

npm start

5.首先安装路由组件:react-router-dom

npm install react-router-dom --save-dev

6.安装 redux 的第三方模块:

npm install redux --save

npm install react-redux --save

7.安装axios

npm i axios --s

8.安装 antd

npm i antd --s

9.安装sass

npm node-sass -D