Skip to content

Are non-serializable objects in the store really that bad? #1654

Answered by markerikson
srmagura asked this question in Q&A
Discussion options

You must be logged in to vote

This is covered in the Redux FAQ entry https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state :

It is highly recommended that you only put plain serializable objects, arrays, and primitives into your store. It's technically possible to insert non-serializable items into the store, but doing so can break the ability to persist and rehydrate the contents of a store, as well as interfere with time-travel debugging.

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. Ultimately, it's your ap…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@srmagura
Comment options

Answer selected by srmagura
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants