redux-ui updateUI返回无效的keyPath

时间:2018-10-29 22:16:44

标签: redux redux-form

我正在通过以下设置使用redux-ui

const uiReducer = (state, action) => {
  console.log('reducer', action.type);

  const initialState = {
    isPartnerListLoading: false
  };

  switch (action.type) {
    case '@@redux-ui/UNMOUNT_UI_STATE':
      console.log(state, action);
      return { ...state };

    case PARTNER_LIST_SUCCESS:
      return {
        ...state,
        isPartnerListLoading: false
      };
  }
  return initialState;
};

const enableReduxUI = ui({
  key: 'editMapping',
  state: { isPartnerListLoading: false },
  reducer: uiReducer
});

当updateUI调用updateUI('isPartnerListLoading', true);时,我会收到

immutable.js:872 Uncaught Error: invalid keyPath
    at invariant (immutable.js:872)
    at updateInDeepMap (immutable.js:1976)
    at updateInDeepMap (immutable.js:1982)
    at Map.updateIn (immutable.js:1280)
    at Map.setIn (immutable.js:1258)
    at reducer (action-reducer.js:62)
    at combination (combineReducers.js:120)
    at computeNextEntry (<anonymous>:1:33861)
    at recomputeStates (<anonymous>:1:34161)
   at <anonymous>:1:37746

正在调用updateUI的组件是redux形式。

使用断点进行调试时,我看到isPartnerListLoading在被调用的不可变Map中。

任何指导或想法将不胜感激。

0 个答案:

没有答案