当我写了ReducerA和ReducerB后,使用combineReducers
const rootReducer = combineReducers({
ReducerA,
ReducerB
});
export default rootReducer;
状态就变成了
state:{
ReducerA:...,
ReducerB:...
}
相对应的ActionA和ActionB也就只能通过对应的Reducer更改对应的state部分
ActionA → state:{ReducerA:...}
ActionB → state:{ReducerB:...}
应该是这样的吗?有办法通过ActionB去影响state:{ReducerA:...}的内容吗?
MYYA
相关分类