0
votes

I am currently learning redux and i have no idea why my code wouldn't work, especially since i have the same code as the instructor. i get these error messages:

ERROR in ./src/redux/store.js 5:26-34

export 'reducers' (imported as 'reducers') was not found in './reducers/index' (possible exports: default)
```and 

Uncaught Error: Expected the reducer to be a function. at a (:2587:23) at :2593:23 at :3548:14 at createStore (redux.js:154:1) at Module../src/redux/store.js (store.js:4:1) at Module.options.factory (react refresh:6:1) at webpack_require (bootstrap:24:1) at fn (hot module replacement:61:1) at Module../src/index.js (App.js:11:1) at Module.options.factory (react refresh:6:1)

This is my ./reducers/index file: 

import { combineReducers } from "redux"; import { productReducers } from "./productReducers";

const reducers = combineReducers({ allProducts: productReducers, });

export default reducers;

and my redux/store.js:

import { createStore } from "redux"; import { reducers } from "./reducers/index";

const store = createStore( reducers, {}, window.REDUX_DEVTOOLS_EXTENSION && window.REDUX_DEVTOOLS_EXTENSION() );

export default store;