You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So if my File is a png, it gets the badge Success, otherwise it stays on pending.
After the update to primereact version 10.8.4, i get the following error when setting fileUploadRef.current!.setFiles(otherFiles)
Argument of type 'File[]' is not assignable to parameter of type 'FileUploadFile[]'.
Type 'File' is not assignable to type 'FileUploadFile'.
Property 'objectURL' is missing in type 'File' but required in type '{ objectURL: string; }'.ts(2345)
fileupload.d.ts(142, 32): 'objectURL' is declared here.
After changing everything to FileUploadFile, i get no warning in my code, but when successfully uploaded a file, i then see N.a.N instead of file metadata in my view, whereas the badge still stays on pending.
Describe the bug
In primereact version 10.7.0, i was able to handle uploaded files as follows:
in primreact version 10.7.0 I was able to manage my uploaded files as follows:
`const handleUpload = (event: FileUploadHandlerEvent) => {
const uploadedFiles = event.files.
let pngFiles: File[] = [];
let otherFiles: File[] = [];
uploadedFiles.forEach((file)=> {
if(file.name.endsWith("png")) {
pngFiles.push(file);
}else{
otherFiles.push(file);
}
}
fileUploadRef.current!.setFiles(otherFiles);
fileUploadRef.current!.setUploadedFiles(pngFiles);
}`
So if my File is a png, it gets the badge Success, otherwise it stays on pending.
After the update to primereact version 10.8.4, i get the following error when setting fileUploadRef.current!.setFiles(otherFiles)
Argument of type 'File[]' is not assignable to parameter of type 'FileUploadFile[]'.
Type 'File' is not assignable to type 'FileUploadFile'.
Property 'objectURL' is missing in type 'File' but required in type '{ objectURL: string; }'.ts(2345)
fileupload.d.ts(142, 32): 'objectURL' is declared here.
After changing everything to FileUploadFile, i get no warning in my code, but when successfully uploaded a file, i then see N.a.N instead of file metadata in my view, whereas the badge still stays on pending.
Reproducer
No response
System Information
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: