# react学习 **Repository Path**: yanweiling/react-study ## Basic Information - **Project Name**: react学习 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-29 - **Last Updated**: 2021-11-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 用来生成uuid的库 npm i uuid 但是这个库比较大 可以使用nanoid yarn add nanoid 进行安装 ## ajax 依赖库 jquery 库 比较重,不建议使用 axios 轻量级 建议使用 1)封装XmlHttpRequest 对象的ajax 2)promise风格 3)可以用在浏览器和node服务器端 安装 yarn add axios ## 路由依赖库 react-router-dom yarn add react-router-dom ## 安装开源蚂蚁金服出品的ant-design yarn add antd Element UI FOR React https://vant-contrib.gitee.io/vant/#/zh-CN---vant 用于手机端样式 ## BrowserRouter和HashRouter的区别 1.底层原理不一样 BrowserRouter使用H5的history的API,不兼容IE9以及以下版本 HashRouter使用的是URL的哈希值 2.url表现形式不一样 BrowserRouter的路径中没有#,HashRouter中有#,例如http:xxxx/#/demo/test 3.刷新后,对路由state参数的影响 BrowserRouter没有任何影响,因为state保存在history对象中 HashRouter刷新后会导致路由state参数丢失