0

I want to setState with file Object using 'redux'. But, It doesn't set state with input value.

Input tag (below)

<div>
  <form>
    <input
      type="file"
      onChange={onChange}
      multiple
    />
  </form>
</div>

Javascript method executing reducer with action.payload (below)

  handleChange = (e) => {
    const { ModalActions } = this.props;
    ModalActions.imageChange({
      image: e.target.files
    })
  }

Reducer setting state

  [IMAGE_CHANGE]: (state, action) => {
    console.log(action.payload.image)
    return state.set('images', List(action.payload.image))
  }

I got result due to use console.log in reducer (below)

console log result

And It doesn't set state with payload

state result

user10953698
  • 107
  • 1
  • 7

0 Answers0