-
Notifications
You must be signed in to change notification settings - Fork 247
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
DropzoneDialog: onSave has difficult to use type, fileObjects is now required #184
Comments
I am experiencing the same issue. Versions
|
hit this problem too. It is because fileObjects is required by DropzoneAreaBase, but it is provided internally by DropzoneArea. However the type annotation of DropzoneAreaBaseProp in index.d.ts inherent that fileObjects from DropzoneAreaBaseProp |
Thanks. I just grabbed a version at master, and I think a few properties that had existed in 3.0.0 are now omitted when they shouldn't be, e.g. the
|
|
I think it'd be worth looking at 38d5c00 again to see what the state was before the changes, so the same properties are still exposed. Also IMO the use of |
Hi @zikaeroh , Thanks for the quick feedback 👍 , I just updated the typings.
Exactly for that reason and unfortunately keeping the TS typings updated is a bit of pain (hoping to fix this with a future migration to TS 😬 ). |
Thanks, my project now builds again!
Yes, being able to write the whole thing and tests in TS will certainly help prevent API drift. |
Bug Report
Describe the bug
38d5c00 updated the TypeScript types, but the new properties for
DropzoneDialog
appear to require properties that don't exist, and functions with signatures that aren't (easily) possible to satisfy.Steps to reproduce
Use
DropzoneDialog
in a TypeScript project.My code original code looked like this:
But the same code now errors with:
As
fileObjects
has been added to the props as a non-optional param. I do not believe this prop exists (it appears to be a state variable, not a prop).Additionally,
onSave
has an awkward type:TS cannot infer the signature of this function, and it seems like a mistake that the first parameter is an event or an array of files. Specifying the type for my function's parameter as
File[]
gives me the message:Expected behavior
Between 3.0.0 and 3.1.0, The TS code still compiles.
Versions
@material-ui/core
version: [e.g. 4.9.2]material-ui-dropzone
version: [e.g. 3.0.1]Additional context
To reproduce, use clone
https://github.com/zikaeroh/codies
, and runyarn upgrade && rm -rf node_modules && yarn install
in the frontend directory to upgrade.yarn build
will print messages (or open the workspace in VS Code and opengameView.tsx
).The text was updated successfully, but these errors were encountered: