?
编写store.js 小state
reducer 怎么来 纯函数
state+action 生成新的state
actions type
return{
}
state
action === setstate(()=>{})
reducer.js 生成新的state 计算
action.js 修改state (数据初始化,和操作方法)
_actionsType.js
页面引入
import {connent}from ‘react-redux‘
1.src 下面有一个大的store>store.js
2.在Route.js注入
3.在src>view>创建action.js ActionTye.js Reducer.js文件
ActionTye.js
Reducer.js
4.在src>view里面创建app.jsx 和_index.js
_index.js
app.jsx
?
原文:https://www.cnblogs.com/xfswy/p/14946103.html