Fanfou Wiki

我等采石之人,当心怀建造大教堂之愿景。

用户工具

站点工具


react

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
react [2021/09/15 09:18] adminreact [2021/10/20 17:38] (当前版本) admin
行 1: 行 1:
 ====== 目录结构 ====== ====== 目录结构 ======
   * https://zh-hans.reactjs.org/docs/faq-structure.html   * https://zh-hans.reactjs.org/docs/faq-structure.html
- 
-====== Yarn ====== 
-  * https://yarnpkg.com/getting-started/install 
-<code bash> 
-npm install -g yarn 
-</code> 
  
 ====== 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
 </code> </code>
  
行 19: 行 13:
   * https://github.com/gsoft-inc/craco   * https://github.com/gsoft-inc/craco
 <code bash> <code bash>
-yarn add @craco/craco +npm install @craco/craco --save
-touch craco.config.js+
 </code> </code>
 +<code bash>
 +echo "module.exports = {};" > craco.js
 +</code>
 +<file javascript craco.config.js>
 +module.exports = {};
 +
 +</file>
 +
 ====== React Router ====== ====== React Router ======
   * https://reactrouter.com/web/guides/quick-start   * https://reactrouter.com/web/guides/quick-start
   * https://github.com/ReactTraining/react-router   * https://github.com/ReactTraining/react-router
 <code bash> <code bash>
-yarn add react-router-dom+npm install react-router-dom --save 
 +</code> 
 + 
 +====== prettier ====== 
 +  * https://prettier.io/ 
 +<code bash> 
 +npm install --save-dev --save-exact prettier 
 +</code> 
 +<file json .prettierrc.json> 
 +
 +  "arrowParens": "avoid", 
 +  "singleQuote": true, 
 +  "semi": true 
 +
 + 
 +</file> 
 +====== lint-staged ====== 
 +  * https://github.com/okonet/lint-staged 
 + 
 +**需要提前安装 prettier --save-dev 或者 eslint --save-dev** 
 +<code bash> 
 +npx mrm@2 lint-staged 
 +</code> 
 + 
 +====== MUI ====== 
 +  * https://github.com/mui-org/material-ui 
 +  * https://mui.com/zh/getting-started/installation/ 
 +<code bash> 
 +npm install @mui/material @emotion/react @emotion/styled --save 
 +</code> 
 + 
 +====== Form validator ====== 
 +  * https://react-hook-form.com/get-started 
 +  * https://github.com/sideway/joi 
 + 
 +<code bash> 
 +npm install --save react-hook-form @hookform/resolvers joi
 </code> </code>
  
行 33: 行 70:
  
 <code bash> <code bash>
-yarn add axios+npm install axios --save 
 +</code> 
 + 
 +====== Lodash ====== 
 +  * https://lodash.com/ 
 + 
 +<code> 
 +npm install --save lodash 
 +</code> 
 + 
 +====== date-fns ====== 
 +  * https://date-fns.org/ 
 + 
 +<code> 
 +npm install date-fns --save
 </code> </code>
  
react.1631668690.txt.gz · 最后更改: 2021/09/15 09:18 由 admin