TypeScript definitions are out of date
See original GitHub issueDo you want to request a feature or report a bug?
- I found a bug
- I want to propose a feature
What is the current behavior?
Latest version of react-dropzone
at the time of submitting this issue is 4.1.3
, however the latest available version of @types/react-dropzone
is 3.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.
- Add a Dropzone component to your page
import * as Dropzone from 'react-dropzone';
- Try to define the
disabledClassName
<Dropzone disabledClassName="my-disabled-classname" >
- Receive a transpilation error:
error TS2339: Property 'disabledClassName' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Dropzone> & Readonly<{ children?: ReactNode; }> & ...'.
Same seems to be happening to acceptClassName
.
What is the expected behavior? Being able to use all properties available in the current version.
Issue Analytics
- State:
- Created 6 years ago
- Comments:18
Top Results From Across the Web
TypeScript definitions are out of date · Issue #102 · eemeli/yaml
The DefinitelyTyped TS definitions haven't been updated since the 1.0 release last fall, and the library's API has expanded a bit since then....
Read more >How do I express a date type in TypeScript? - Stack Overflow
The type is Date : const d: Date = new Date(); // but the type can also be inferred from "new Date()" already....
Read more >Serverless service file Typescript definitions will never be ...
Serverless service file Typescript definitions will never be outdated again! Illustration for automated Typescript definitions generation.
Read more >Handling date strings in TypeScript - LogRocket Blog
When dates are string variables, TypeScript infers the string type by default, making them tough to handle.
Read more >Documentation - tsc CLI Options - TypeScript
Flag Type Default
‑‑allowJs boolean false
‑‑allowUmdGlobalAccess boolean false
‑‑allowUnreachableCode boolean
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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
import Dropzone = require('react-dropzone);
@ashok-sc It seems like the typescript-definition is still wrong.
I got it to work using:
Either you can change typing locally row 51 in index.d.ts
export = Dropzone;
=>export default Dropzone;
But that will get overwritten of course…So I instead added this when I import the module:
And this works both in typescript and runtime…