I'm trying to integrate a logger in my redux app, using the applyMiddleware api, but when I trigger an action I got this error:
Actions may not have an undefined "type" property. Have you misspelled a constant?
This is strange because all of my action creators returns objects with this format:
{ type : ..., payload : {...}}
. And more, in the console of the browser the printed object has the property 'type'.
I set up the store in this way:
const logger = store => next => action => {
console.log(action);
return next(store, action);
}
const store = createStore(
reducer,
applyMiddleware(logger));
export default store;
I got stuck.