I'm using hooks with filepond and I can't seem to extract the file from the filepond. My code is shown below. I know that my code is incorrect since the embed does not actually give the location of the file but I have no idea how to fix this.
const [files, setFiles] = useState([])
<FilePond
files={files}
allowMultiple={false}
acceptedFileTypes={['application/pdf']}
maxFileSize='10MB'
onupdatefiles={fileItems => {
const tmp = fileItems.map(fileItem => fileItem.file)
setFiles(tmp)
setContinue(tmp.length)
}}
/>
<embed
src={files[0] && files[0].name}
type='application/pdf'
width='100%'
height='100%'
/>
I know I can use the filepond plugin with an image preview (FilePondPluginImagePreview), but it's not portable (can only be put inside the filepond) so I'm choosing not to use it.
EDIT:
console.log(files[0]) gives me this. This is the same thing as tmp[0].