KarimMokhtar / react-drag-drop-files

Light and simple Reactjs drag and drop files library to use with very flexible options to change, so you put whatever the design you want for your drop-area. Users can drag and drop or even select the file anywhere in the window.
MIT License
248 stars 91 forks source link

Fix typescript types #138

Open HironTez opened 6 months ago

HironTez commented 6 months ago

The only thing that stops me from using this library is the bad typescript types

KarimMokhtar commented 6 months ago

Thanks for your feedback. You are welcome by opening a PR to fix it.

iGoodie commented 6 months ago

Hey! 👋🏼
A totally temporary solution, until it is fixed:

import { FileUploader } from "react-drag-drop-files";
import type FileUploaderSrc from "react-drag-drop-files/dist/src/FileUploader";

const FileUploaderTyped: typeof FileUploaderSrc = FileUploader;

// Props are now properly typed
<FileUploaderTyped />

Seems like the .d.ts file is being built with wrong contents. Hope it gets fixed soon :smile: