Redux toolkit Presist Error

Hey guys im getting this error when i try to get presist in redux-toolkit. I have tried adding a middleware from the redux docs but getDefaultMiddleware is now depricated and the other stuff didnt work for me. Im curious if anyone has gone through this issue. (Working with redux toolkit cuz thats what my client wants )
import { configureStore } from '@reduxjs/toolkit';
import cartReducer from './state/cartSlice';
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';

const persistConfig = {
  key: 'root',
  storage,
};
const persistedReducer = persistReducer(persistConfig, cartReducer);

export const store = configureStore({
  reducer: {
    cart: persistedReducer,
    
  },
});
export const persistor = persistStore(store);

This is my index.js store file for redux toolkit. Appreciate all the help i can get 🙂
eef.png
Was this page helpful?