Menu

📰
0

Reddit - Please wait for verification

/r/ReactJS - The Front Page of React·/u/Tyrone2209·3 days ago
#CnigB2jJ
Reading 0:00
15s threshold

I have this error Uncaught TypeError: storage.getItem is not a function on this line const persistor = persistStore(store) This is what I have on my store/index.ts import { configureStore } from "@reduxjs/toolkit"; import { useDispatch, useSelector } from 'react-redux'; import storage from 'redux-persist/lib/storage'; import { combineReducers } from "@reduxjs/toolkit"; import { persistReducer } from "redux-persist"; import authReducer from './authSlice' const persistConfig = { key: 'root', storage, whitelist: ['auth'] } const rootReducer = combineReducers({ auth: authReducer, }) const persistedReducer = persistReducer(persistConfig, rootReducer) export const store = configureStore({ reducer: persistedReducer, middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: { ignoredActions: ['persist/PERSIST'], }, }), }) export type RootState = ReturnType export type AppDispatch = typeof store.dispatch export…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More