Can combineReducers be nested or it should be used once to combine all the reducers into one?
Is that a bad approach to create a tree structure of store by combining reducers on each step?
Or probably there is any other way to keep root store clean (want to avoid placing all tree leaves into root store)
Pseudocode structure example:
rootReducer = combineReducers({
router, // redux-react-router reducer
account: combineReducers({
profile: combineReducers({
info, // reducer function
credentials // reducer function
}),
billing // reducer function
}),
// ... other combineReducers
})
});
Sure, it's a fine idea.
Hi im implementin a multiple combineReducer,
// schoolReducer.js
export default combineReducers({
company: companyReducer,
profile: profileReducer,
});
// studentInfo.js
export default combineReducers({
student: studentReducer,
course: courseReducer,
});
//rootReducer.js
export default combineReducers({
school: schoolReducer,
student: studentInfo,
});
having an error
Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.
@justinlazaro-ubidy :
This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux where there are a lot more people ready to help you out - you'll probably get a better answer faster. Thanks!
Most helpful comment
Sure, it's a fine idea.