激活无关动作时Redux reducer错误

时间:2017-09-01 15:35:30

标签: reactjs redux

在解雇不相关的行动时,我得到了奇怪的错误。

enter image description here

articlesReducer.js

```

import merge from "lodash/merge";

const articles = (state = {}, action) => {
  if (action.payload && action.payload.entities && action.payload.entities.articles) {
    return merge({}, state, action.payload.entities.articles);
  }
  return state;
};

export default articles;

```

导致错误的操作:

```

export const changeHomePageTabTo = tab => ({
  type: actionTypes.HOMEPAGE_CHANGE_TAB,
  payload: { tab }
});

```

如果我将其更改为:

export const changeHomePageTabTo = tab => ({ type: actionTypes.HOMEPAGE_CHANGE_TAB, tab });

一切正常。无法弄清楚导致这种情况的原因。有什么想法吗?

由于

0 个答案:

没有答案