Fixed to const [files, setFiles] = useState([]);, so that files is an array now and accept multiple input files. Also, Fixed setFiles to setFiles([...files, event.target.files]);
Added a function to validate file input (size <= 10 MB and must be a PDF file)
Called validating input function in fileChange() before adding file to the files array
Feel free to ask me for any correction, thanks.
Fixes #37
Details:
const [files, setFiles] = useState([]);
, so thatfiles
is an array now and accept multiple input files. Also, FixedsetFiles
tosetFiles([...files, event.target.files]);
fileChange()
before adding file to thefiles
arrayFeel free to ask me for any correction, thanks. Fixes #37