我有以下代码:
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
?
我没有正确初始化它吗?
尝试将JSON.stringify(store)
替换为JSON.stringify(store.getState())