I have written a container component using redux and my implementation for mapDispatchToProps
looks like this
const mapDispatchToProps = (dispatch, o
You can try to use:
redux-named-reducers
Which allows you to get state anywhere in your code like so:
const localState1 = getState(reducerA.state1)
const localState2 = getState(reducerB.state2)
Likewise in mapDispatchToProps:
const mapDispatchToProps = dispatch => {
return {
onClick: () => {
dispatch(someAction(getState(moduleA.state1)));
}
};
};