Mac上安装create-react-app
生活随笔
收集整理的這篇文章主要介紹了
Mac上安装create-react-app
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Mac上安裝create-react-app,經常出現安裝不上,這里說一下辦法:
方法一:
1. sudo npm install -g create-react-app 2. create-react-app my-react 3. cd my_code 4. npm start方法二:
1. yarn global add create-react-app2. create-react-app my-app3. cd my_code4. yarn start安裝redux
yarn add i redux -S 數據狀態管理 yarn add i react-redux -S react和redux做整合 yarn add i redux-thunk -S 發送異步請求 yarn add i react-router-dom -S 視圖跳轉,路由 yarn add i axios -S 發送請求 yarn add i antd -S antdDesign UI庫antd去除多余組件
在用antd-mobile時,需要配置按需加載,那自然就用到了 babel-import-plugin
那么在用到這個插件的時候,自然就想到要用 react-app-rewired 來覆蓋配置。
react-scripts 升級到 2.1.2 以前:
(1)yarn add i babel-plugin-import -D
(2)項目根目錄創建config-overrides.js 內容如下
react-scripts 升級到 2.1.2 和以后安裝:
(1)yarn add i customize-cra -D
(2)項目根目錄創建config-overrides.js 內容如下
總結
以上是生活随笔為你收集整理的Mac上安装create-react-app的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 手机通过无线路由器如何设置光猫 如何设置
- 下一篇: 如何设置顶部和底部固定,中间填满