React · Senior · Question 34 of 75

Why don't you put promises, class instances and functions into the Redux store?

Explanation

The store should be a plain serializable tree: it's logged, persisted (redux-persist), replayed in time travel and passed from the server during SSR. RTK warns about non-serializable values in dev. Keep non-serializable objects outside the store and store their ids in it.

Further reading

Problem with a question

React · Senior · question 34

Test yourself

Take the React · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz