Reputation: 1838
I'm trying to add a File Object to my Redux store.
My reducer looks like this:
...
case 'SET_INVOICE':
console.log(action.invoice); //File Object
return { ...state, invoice: action.invoice};
...
Instead of the File Object added to the Redux store, the result is an empty object invoice: { }
Upvotes: 3
Views: 1522
Reputation: 2189
It looks empty on devtool but it's not! Try to show redux store data in console log, you will see that it is not empty
Upvotes: 0
Reputation: 1035
Redux only stores datatype that is serializable, and File
is not one of them. Try storing ES6 Map
or Set
. They will both appear as empty object as well.
Upvotes: 1