Open liranUziel opened 1 year ago
You need to also include the Thunk middleware, which will intercept and stop non-serializable values in action before they get to the reducer. You can use the resource as a guide Log rocket
You need to also include the Thunk middleware, which will intercept and stop non-serializable values in action before they get to the reducer. You can use the resource as a guide Log rocket
if i use redux-toolkit that includes redux-thunk by default it not enough?
If you have thunk and you still have the issue, it is most likely that you didn't exclude persist action type in the middleware check for your store.
import { FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER } from 'redux-persist'
const store = configureStore({
reducer: ....,
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: {
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
},
}),
})
This should fix the non-serializable value error
. This is redux-toolkit guide on that
Hello everyone, I am working on a small project with only two reducers one to store group Info (only id) and one for map Info (more complex start point, endpoint, and other data will be added later) I create my project using Vite the code is in TypeScript and uses react framework and redux-toolkit After adding redux-persist to my project I have an issue with non-serializable value for both reducers.
This is my store.ts code
and this is my main.tsx
I am new to redux (only my second project) and redux-persist.