一、添加依賴
1. yarn add redux react-redux redux-thunk react-router-dom
// redux-thunk 讓action可以返回函數(shù)的中間件
2. yarn add redux-logger --dev
//輔助redux,可在打印中看到redux一切行為和數(shù)據(jù)
二、創(chuàng)建項目目錄結(jié)構(gòu)

目錄結(jié)構(gòu)圖
三、配置Redux(<font color=#ff0000>文件具體路徑請看項目目錄結(jié)構(gòu)</font>)
1. actionTypes 公用屬性

actionTypes公用type屬性
2. 添加一個action

action行為
3. 寫入與action對應(yīng)的reducer

處理action傳來的信息
4. 合并reducer ,便于處理reducer過多導(dǎo)致的麻煩

合并Reducer
5. 配置store

配置store
-
將store寫入啟動程序中
添加store進(jìn)根目錄index.js中 -
結(jié)束
三、配置路由
配置路由,并且嘗試使用redux

