Answer the question
In order to leave comments, you need to log in
Middleware is not a function, why such an error?
Good afternoon! Please tell me what could be the problem?
I'm trying to make an asynchronous request, according to I want to use redux-thunk applyMiddleware It gives an
error - middleware is not a function .
It is not clear how the full picture should look like, what should be returned from actions!?
To use applyMiddleware(thunk) should I just add it to createStore?
I don't quite understand how it works.
I would be very grateful for any help!
store.js code
const mapStore = createStore(
rootReducer,
compose(applyMiddleware(thunk), window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__())
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question