why can't I export 'combineReducers' (imported as 'combineReducers') was not found in 'react-redux'

2.2k Views Asked by At

Here is my main js code and why combine all reducer cartredux\src\redux\reducers\main.js

import {combineReducers} from "react-redux";
import { cartreducer } from "./reducer";


const rootred = combineReducers({
    cartreducer
});


export default  rootred;
2

There are 2 best solutions below

0
markerikson On

As a comment pointed out: the combineReducers function is part of either the @reduxjs/toolkit or redux packages, because it's about the non-UI portion of the logic. It's not part of the react-redux package, which is specifically about React UI integration with Redux.

1
Ankit Sharda On

Make sure to Import combineReducers from redux.

import {combineReducers} from "redux"