score:1

Accepted answer

looks like the error is being thrown in that line:

e.target.files[0]

it's because e.target.files can be null - for instance, if you open the select file window and click cancel. i suggest you to check against null value and not to setstate if there is no files selected:

onchangehandler(e) {
  if(!e.target.files) {
    return;
  }

    this.setstate({
      audio: e.target.files[0],
      image: e.target.files[1],
      name: e.target.value
    });
  }

Related Query

More Query from same tag