KarimMokhtar / react-drag-drop-files

Light and simple Reactjs drag and drop files library to use with very flexible options to change, so you put whatever the design you want for your drop-area. Users can drag and drop or even select the file anywhere in the window.
MIT License
248 stars 91 forks source link

Can't upload same file multiple times. #99

Closed Arsh1a closed 1 year ago

Arsh1a commented 1 year ago

handleChange does not work if we upload same file again.

enjoijkee commented 1 year ago

If you mean re-uploading after value resetting, pass your value into fileOrFiles property. Helped for me.

const [file, setFile] = useState<File>(null)
...
<FileUploader  
  types={ ['mp4', 'mkv'] }
  handleChange={ (file: File) => setFile(file) }
  fileOrFiles={ file } />