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
TypeScript definitions are out of date #509
Comments
A note: in TS you should not import React-dropzone with * as imports. This module is exported as common JS in its source. You should use |
I have no idea who made those type definitions. They aren't supported by this repository. So you might want to file this bug at the appropriate repository. Ideally, please submit a PR with the fix. |
Reopening till the appropriate PR is merged. |
@okonet should we pin this then since we have no idea when that PR is submitted/merged? or do you know which it is from that repo? |
My updated TypeScript definitions were merged into DefinitelyTyped almost two weeks ago as you can see in the pull request referenced above. They're currently live on https://www.npmjs.com/package/@types/react-dropzone. This issue can be closed as resolved. |
@codeaid thanks for the update! will close |
This seems related. When I import Dropzone as stated above:
I get the following error in at runtime:
Changing the import to
What's happening here? |
@ashok-sc It seems like the typescript-definition is still wrong. I got it to work using:
Either you can change typing locally So I instead added this when I import the module:
And this works both in typescript and runtime.. |
This module is not exported in a way where you actually have es6 exports. You need to use a commonjs import. The typescript types are correct |
Thanks @FlayaN ! Will give that a shot. |
I tried what @FlayaN suggested but it doesn't work. Packages
Code
` |
Same as @michaelsync here... Did someone managed to solve this? Also, tried to import import Dropzone = require('react-dropzone'); but I get ReferenceError: Dropzone is not defined |
@promgamer what is your tsconfig? |
{ "compilerOptions": { "outDir": "build/dist", "module": "esnext", "target": "es5", "lib": ["es6", "dom"], "sourceMap": true, "allowJs": true, "jsx": "react", "moduleResolution": "node", "rootDir": "src", "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true }, "exclude": [ "node_modules", "build", "scripts", "acceptance-tests", "webpack", "jest", "src/setupTests.ts" ]} |
|
I am using esnext (module) and es6 (target) I downgraded the packages as below. and those versions work for me.
|
@michaelsync tried that already, doesn't work here... |
For those wondering, I've found in typescript github that this behaviour was a bug that was fixed on v2.6! 😄 My problem was that I was using v2.5.3 |
Do you want to request a feature or report a bug?
What is the current behavior?
Latest version of
react-dropzone
at the time of submitting this issue is4.1.3
, however the latest available version of@types/react-dropzone
is3.13.1
and it's already missing at least one property definition.If the current behavior is a bug, please provide the steps to reproduce.
disabledClassName
Same seems to be happening to
acceptClassName
.What is the expected behavior?
Being able to use all properties available in the current version.
The text was updated successfully, but these errors were encountered: