无法初始化商店的状态

时间:2018-01-29 19:22:45

标签: redux redux-mock-store

我有以下代码:

import configureMockStore from 'redux-mock-store';

const initialState = { someField: {} };
const mockStore = configureMockStore();
store = mockStore(initialState);
console.log("Store is: " + JSON.stringify(store));

console.log打印:

  Store is: {}

打印商店时为什么不显示someField

我没有正确地初始化它吗?

1 个答案:

答案 0 :(得分:0)

尝试将JSON.stringify(store)替换为JSON.stringify(store.getState())