wesbos / advanced-react-rerecord

Trying things out. Feel free to follow along
247 stars 36 forks source link

Filter file array for file selected #52

Closed ahmedjahmi closed 3 years ago

ahmedjahmi commented 4 years ago

The file type conditional in the definition of useForm() was returning an array for value instead of the file indexed at the beginning of that array. Wasn't sure if you had future plans for uploading multiple photos, but this fixes the error considering just one photo is uploaded.

wesbos commented 3 years ago

I not sure I follow this one. [value] = e.target.files; is the same as value = e.target.files[0]

Was it returning and array of arrays?