1. Поправьте
mapStateToProps:
const mapStateToProps = state => {
return {
items: state.items.items,
error: state.items.error,
loading: state.items.loading
};
};
По-хорошему напишите селекторы.
2. Измените кейс
FETCH_SUCCESS:
export function items(state = initialState, action) {
const { type, payload } = action;
switch (type) {
// some code
case "FETCH_SUCCESS":
return {
...state,
items: [ ...state.items, ...payload.items ],
loading: false,
};
// some code
}
}
3. По возможности сокращенный вариант:
export const fetchProductsBegin = () => ({ type: FETCH_BEGIN });
const mapStateToProps = state => ({
items: state.items.items,
error: state.items.error,
loading: state.items.loading,
});
https://codesandbox.io/s/jprm2omlr5