I have done hours of debugging and I am unable to find the solution.
import { combineReducers, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { configureStore } from '@redux.js/toolkit';
import { composeWithDevTools } from 'redux-devtools-extension';
let reducer = combineReducers({
// contains all reducers
});
// here all our data will lie
const initialState = {};
const middleware = [thunk];
const store = configureStore(
reducer,
initialState,
composeWithDevTools(applyMiddleware(...middleware))
);
export default store;
Error:
I just want a todo list to be displayed on browser, which I have written in my App.js
.
2
Answers
Try:
Help for posting code in Stack Overflow:
The
configureStore
utility takes a single argument object with propertiesreducer
,middleware
,devTools
,preloadedState
, andenhancers
.Note that I didn’t include the
Thunk
middleware since Redux Toolkit comes with the Thunk middleware by default, and I didn’t include any regardingdevTool
since these are also enabled by default.