I'm completely aware of the downsides of storing non-serializable values to Redux state. Like the Redux docs say:
If you are okay with things like persistence and time-travel debugging potentially not working as intended, then you are totally welcome to put non-serializable items into your Redux store.
So, I'm just prototyping to try out some ideas. I might refactor the code in the future to eliminate these function objects from state, but at the moment these warnings are just flooding my console, burying other messages I might actually care about.
Is there perhaps some switch to toggle these warnings on/off?
It's a redux-toolkit
error and the whole error links to documentation that shows how you can disable the errors for specific actions.
https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data
To quote:
However, if you do need to turnoff those warnings, you can customize the middleware by configuring it to ignore specific action types, or fields in actions and state:
configureStore({
//...
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: {
// Ignore these action types
ignoredActions: ['your/action/type'],
// Ignore these field paths in all actions
ignoredActionPaths: ['meta.arg', 'payload.timestamp'],
// Ignore these paths in the state
ignoredPaths: ['items.dates'],
},
}),
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With