I have a simple file chunking system to upload data to a server via many chunks, to do this I delegate the splitting and uploading task to a dedicated component... However when passing the received Blob, from user, to my dedicated component, the prop in that component doesn't seem to contain anything... Indeed Blob.slice() throws TypeError: Illegal invocation
const Uploader = ({ fileBlob }) => {
useEffect(() => {
let chunk = fileBlob.slice(0, fileBlob.size() / 2); // Throws
});
return (<some stuff />)
}
const BlobFromUser = () => {
const fileUpload = (fileBlob) => {
//let chunk = fileBlob.slice(0, fileBlob.size / 2); Tried here and it works
notify(<Uploader fileBlob={fileBlob} />);
}
return (<file upload user form triggers fileUpload()/>)
}