使用组合化简器,您的商店将具有如下数据结构:
{ DimensionPickerReducer: { dimenisionName: '', pickerIsLoading: false, pickerError: '', currentAttribute: '', attributeList: [] }, DataTableReducer: { tabledata: [], tableIsLoading:false, tableError: '' }}因此,您应该调整容器以与组合商店一起使用。例如,
DimensionPickerContainer.js您应该更改
mapStateToProps功能:
const mapStateToProps = (state) => { return { attributeList : state.DimensionPickerReducer.attributeList, currentAttribute : state.DimensionPickerReducer.currentAttribute }}您还可以在商店中命名自己的reduce,这样它们在数据结构上就不会看起来很丑。例如
combineReducers({ dimensionPicker:DimensionPickerReducer, dataTable: DataTableReducer})


