【发布时间】:2019-10-07 05:36:21
【问题描述】:
我不知道,如何组合我的减速器的正确方法是什么。
在根减速器中,我有这样的页面减速器:
export default combineReducers({
guidePage,
homePage,
})
所以,问题是,我想在 homePage reducer 中放另一个 reducer,我该怎么做呢?
像这样:
homePage : {
propHomePage: foo,
anotherReducer: {
anotherReducerProp: foo2
}
}
当我使用 combineReducers({homePage, anotherReducer}) 我得到这样的状态:
{
homePage: {propHomePage: foo}
anotherReducer: {anotherReducerProp: foo2}
}
这是错误的
【问题讨论】:
标签: redux react-redux reducers