react
差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
react [2021/09/15 00:33] – admin | react [2021/10/20 17:38] (当前版本) – admin | ||
---|---|---|---|
行 1: | 行 1: | ||
====== 目录结构 ====== | ====== 目录结构 ====== | ||
* https:// | * https:// | ||
- | |||
- | ====== Yarn ====== | ||
- | * https:// | ||
- | <code bash> | ||
- | npm install -g yarn | ||
- | </ | ||
====== React App ====== | ====== React App ====== | ||
行 13: | 行 7: | ||
<code bash> | <code bash> | ||
- | yarn create react-app my-app --template typescript | + | npx create-react-app my-app --template typescript |
</ | </ | ||
行 19: | 行 13: | ||
* https:// | * https:// | ||
<code bash> | <code bash> | ||
- | yarn add @craco/ | + | npm install |
</ | </ | ||
+ | <code bash> | ||
+ | echo " | ||
+ | </ | ||
+ | <file javascript craco.config.js> | ||
+ | module.exports = {}; | ||
+ | |||
+ | </ | ||
+ | |||
====== React Router ====== | ====== React Router ====== | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
<code bash> | <code bash> | ||
- | yarn add react-router-dom | + | npm install |
+ | </ | ||
+ | |||
+ | ====== prettier ====== | ||
+ | * https:// | ||
+ | <code bash> | ||
+ | npm install --save-dev --save-exact prettier | ||
+ | </ | ||
+ | <file json .prettierrc.json> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | ====== lint-staged ====== | ||
+ | * https:// | ||
+ | |||
+ | **需要提前安装 prettier --save-dev 或者 eslint --save-dev** | ||
+ | <code bash> | ||
+ | npx mrm@2 lint-staged | ||
+ | </ | ||
+ | |||
+ | ====== MUI ====== | ||
+ | * https:// | ||
+ | * https:// | ||
+ | <code bash> | ||
+ | npm install @mui/ | ||
+ | </ | ||
+ | |||
+ | ====== Form validator ====== | ||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | <code bash> | ||
+ | npm install --save react-hook-form @hookform/ | ||
</ | </ | ||
行 32: | 行 70: | ||
<code bash> | <code bash> | ||
- | yarn add axios | + | npm install |
+ | </ | ||
+ | |||
+ | ====== Lodash ====== | ||
+ | * https:// | ||
+ | |||
+ | < | ||
+ | npm install --save lodash | ||
+ | </ | ||
+ | |||
+ | ====== date-fns ====== | ||
+ | * https:// | ||
+ | |||
+ | < | ||
+ | npm install date-fns --save | ||
</ | </ | ||
react.1631637183.txt.gz · 最后更改: 2021/09/15 00:33 由 admin