Package Exports
- react-drag-drop-files
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-drag-drop-files) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Drag and Drop Files
Light and simple reactjs drag and drop library.
Demo
Installation
Install it from npm (using NPM).
npm i --save react-drag-drop-files
Usage
Using react hooks just as simple as:
import React, { useState } from "react";
import { FileUploader } from "react-drag-drop-files";
const fileTypes = ["JPG", "PNG", "GIF"];
function DragDrop() {
const [file, setFile] = useState(null);
const handleChange = file => {
setFile(file);
};
return (
<FileUploader
handleChange={handleChange}
name="file"
types={fileTypes}
/>
);
}
export default DragDrop;
Upcoming...
- Files Validation
- Adding Multiple Files
- Testing
- Typescript Support
- Contribution Guide
- Notify With Errors