-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interface 'FileWithPath' incorrectly extends 'File' #12
Comments
It looks like (in my case at least) this is caused by a conflicting type. I'm not sure if there's a way to specify that this is extending the |
I am also hitting this problem when using Electron extends File to always have a Error I get:
|
what works for me is just locking my react-dropzone version to 10.1.7, and this seems so far to be in line with the DefinitelyTyped types. if and when this changes, i'll bump it. |
Any update or solution about this typing problem? |
Is everyone having this problem with Electron? To be fair I think it's Electron's fault maybe? I'm not sure if there's a way to say that something is JUST extended from 'dom' ... maybe import it as from 'dom' ?? I haven't tried that |
There's a simple fix for this... /** Provides information about files and allows JavaScript in a web page to access their content. */
interface DOMFile extends Blob {
readonly lastModified: number;
readonly name: string;
}
export interface FileWithPath extends DOMFile {
readonly path?: string;
} ... this should work and avoid conflicts since typescript types are structural. FileWithPath will be compatible with File from DOM as I lifted the interface for DOMFile right from their namespace. |
Sent a PR for this: |
I got the same issue, using react-dropzone 11, Typescript, and Electron. Any news about your PR being merged? |
🎉 This issue has been resolved in version 0.1.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The text was updated successfully, but these errors were encountered: