一愕秫、添加依賴
1. yarn add redux react-redux redux-thunk react-router-dom
// redux-thunk 讓action可以返回函數的中間件
2. yarn add redux-logger --dev
//輔助redux,可在打印中看到redux一切行為和數據
二磷杏、創(chuàng)建項目目錄結構
三、配置Redux(<font color=#ff0000>文件具體路徑請看項目目錄結構</font>)
1. actionTypes 公用屬性
2. 添加一個action
3. 寫入與action對應的reducer
4. 合并reducer 凌摄,便于處理reducer過多導致的麻煩
5. 配置store
-
將store寫入啟動程序中
-
結束
三尿孔、配置路由