If I didn't have an ARRAY of files, this method would work perfectly. However, it needs to be in the form of an Array.
let file1 = new File([""], "filename");
let file2 = new File([""], "filename");
let files = [file1, file2];
let formData = new FormData();
formData.append('files', files);
In JavaScript, this code runs smoothly. But in TypeScript, I encounter this error:
TS2345: Argument of type 'Blob[]' is not assignable to parameter of type 'string | Blob'. Type 'Blob[]' is not assignable to type 'string'.
Is there any alternative solution instead of using // @ts-ignore?
Additionally, the REST API that I am interacting with requires the formData to be a Blob/File Array, so making changes there is not an option.