JSPM

  • Created
  • Published
  • Downloads 74614
  • Score
    100M100P100Q210381F
  • License MIT

Light React Drag & Drop files and images library styled by styled-components

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.

Installation

Install it from npm (using NPM).

Usage

just as simple as:

import React, { useState } from "react";
import { FileUploader } from "react-drag-drop-files";
import "./App.css";
const fileTypes = ["JPG", "PNG", "GIF"];
function DragDrop() {
  const [file, setFile] = useState(null);
  const handleChange = file => {
    setFile(file);
  };
  return (
    <div className="App">
        <FileUploader 
            file={file} 
            handleChange={handleChange} 
            name="file" 
            types={fileTypes} 
        />
    </div>
  );
}

export default DragDrop;

License

MIT