I have a formdata object. I'm moving this into a reducer with redux. Then can I define the file contained in this formData into INITIAL_STATE?
var INITIAL_STATE = { stepOneInformation: {} }
REDUCER
case STEP_ONE_SET_DATA:
const data = {
file : action.value.get('file'),
aboutMe : action.value.get('aboutMe'),
title : null
}
return {
...state,
stepOneInformation: data
}
I defined the file in the formdata object to the data variable parameter. But the file object looks blank when reading the state
console.log(action.value.get(file))in your reducer and then open the console when performing the thing that triggers the action. The code you've shown itself is fine, it's the code you haven't shown where the problem is.When reading the initial state- but you didn't set the file object as part of your initial state - you set it in response to an action?