Open zhaoyi0113 opened 5 years ago
Would you support typescript if it's possible? @bevacqua
Simply create an index.d.ts
file and add these lines:
declare module 'react-dragula' {
export default function(
containers: Array<HTMLElement>,
options: import('dragula').DragulaOptions
): import('dragula').Drake;
}
and run yarn add @types/dragula --dev
or npm install @types/dragula --save-dev
It'd be great if this was just included in the package!
@JoshMcCullough your comment gave me the idea to add the type definition to the DefinitelyTyped repository. My PR just got merged: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46828#event-3678017351
So now you can just run yarn add @types/react-dragula
or npm install @types/react-dragula --save
, and it should work 🎉
@AdrianMrn Great, thanks!
I get an error
Could not find a declaration file for module 'react-dragula'
when usingreact-dragula
intypescript
. Where can I find the type definition for this component?