I am building a Mobile application using ReactNative and TypeScript. I am trying to upload file using Axios so that I need to make multipart/form-data
request. In javascript I can pass the file data to the form data request like this.
formData.append(`image_file`, { uri: form.image_file.path, name: form.image_file.filename, type: form.image_file.mime });
Now, I am trying to do the same for TypeScript. But when I pass the same object in the TypeScript, I am getting the following compilation error.
So that I had to cast the object into any
type as follow.
How can I fix that error without casting the object into any
because I am not a fan of using any
type.