Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: middleware is not a function (it is undefined)

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

like image 374
Kirito Avatar asked Jun 30 '26 23:06

Kirito


1 Answers

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'
like image 177
420Boys Gaming Avatar answered Jul 04 '26 21:07

420Boys Gaming