Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to use applyMiddleWare in redux

Iam a newbie to redux.I imported createStore,combineReducers from redux and these work fine.

import {createStore,combineReducers} from "redux";

But iam unable to use applyMiddleWare

import {createStore,combineReducers,applyMiddleWare} from "redux";

The error is

./src/index.js 63:101-116 'redux' does not contain an export named 'applyMiddleWare'.

and when i try to import like this

import applyMiddleWare,{createStore,combineReducers} from "redux";

It shows

./src/index.js 63:101-116 "export 'default' (imported as 'applyMiddleWare') was not found in 'redux'

I did not change or modified any packages. My Package.json shows dependencies as

"dependencies": {
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-redux": "^5.0.7",
"react-scripts": "1.1.4",
"redux":"^4.0.0",
"redux-logger": "3.0.6"
}

Advance thanks for helping!!

like image 968
Thakur Karthik Avatar asked May 31 '18 05:05

Thakur Karthik


1 Answers

The 'w' in the applyMiddleWare should be small while importing. applyMiddleware

So you should import like:

import { applyMiddleware } from 'redux';
like image 194
Hitesh Chaudhari Avatar answered Sep 25 '22 19:09

Hitesh Chaudhari