Reputation: 1
I was using Redux Toolkit and tried to use Redux Persist but on terminal it shows this.
A non-serializable value was detected in an action, in the path: `register`. Value: [Function: register]
Take a look at the logic that dispatched this action: {
type: 'persist/PERSIST',
register: [Function: register],
rehydrate: [Function: rehydrate]
}
Upvotes: 0
Views: 44
Reputation: 67
Redux store is designed to handle primitive types only. To ensure optimal performance and avoid potential issues, you should avoid storing complex objects or functions directly in the store. Instead, use primitive types such as strings and numbers.
Like in reducer
initialState = {
value : getValue(){}
}
It is not valid I demonstrate initialState as an Example.
Upvotes: -1