redux tookit when using a middleware builder function, an array of middleware must be returned
So I'm gettingĀ Uncaught Error: when using a middleware builder function, an array of middleware must be returned
This is my code
import {
configureStore,
compose,
combineReducers,
applyMiddleware
} from "@reduxjs/toolkit";
import thunk from "redux-thunk";
const rootReducer = combineReducers({});
const middleware = applyMiddleware(thunk);
const composeWithDevTools =
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const composedMiddleWare = composeWithDevTools(middleware)
const store = configureStore({
reducer: rootReducer,
middleware: composedMiddleWare,
devTools:
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
})
export default store;