I have 2 gearboxes that are combined in Root Reducer and used in the store. The first AllTracksReducer reducer should return the object, and the second Favorite the array.
When I create a container component and a mapStateToProps method in a connection, for some reason, the return state of the store is an object with two gear objects that store data, and not just an object containing correction data, as expected.
function mapStateToProps(state) {
debugger:
console.dir(state)
return {
data: state.AllTracksReducer.data,
isLoading: state.AllTracksReducer.isLoading
}
}
export default connect(mapStateToProps)(AllTracksContainer);
therefore, in mapStateToProps, in order to get to the correct state of the state, I have to say state.AllTracksReducer.data ... But did I expect the data to be available directly to the state object?