Using reducer (combineReducers) in React Redux

1.3k Views Asked by At

I am trying to use combineReducers in React redux but i keep receiving this error in the console.

"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers

the store.js

import { configureStore } from "@reduxjs/toolkit";
import { combineReducers } from "redux";

const reducer = combineReducers({});

const initialState = {};

const store = configureStore(reducer, initialState);

export default store;
1

There are 1 best solutions below

0
On BEST ANSWER

Like mentioned on the documentation, you must transmit an object with several method as properties to combinereducers. These methods are the reducers.

To make it simple, what you transmit to combineReducers must be an object only with methods that have the signature that is described here