State Management · Senior · Question 12 of 75
Why shouldn't you put promises, class instances or functions into the Redux store?
- ✓Correct answer: It breaks serializability: DevTools, persistence, SSR transfer and time travel
- 2Redux can only store strings and numbers
- 3It makes
useSelectordozens of times slower
Explanation
The store should be plain data that can be logged, saved and replayed. Keep non-serializable objects outside (e.g. in a module or listener) and store ids/serializable snapshots instead.