When I am integrating my React-Native app with Redux-Thunk I got this error:
TypeError: middleware is not a function (it is undefined)
I already tried everything on another stack overflow case but still error.
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import logger from 'redux-logger';
import app from './reducers/index';
export default function configureStore() {
const store = createStore(app, applyMiddleware(thunk, logger));
return store;
}
error image emulator
This problem will be solved like this.
Problem in this line
import thunk from 'redux-thunk'
Just replace
import thunk from 'redux-thunk'
with
import {thunk} from 'redux-thunk'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With