0.0.3 • Published 5 years ago

drop-file-provider v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

##DROP FILE REACT

commits license version

Simple component to takes files dropped in a

####Documentation

DropProvider offers a surrounding component that's implements drop files interface.


Props

propsDescription
onDropfunction executed when some file is dropped in DropProvider children. Receive a files array
backdropfunction that's return a component to be rendered when some file is hovering the childrens of DropProvider.

####Example

imṕort React from 'react';
import {DropProvider} from  "drop-file-provider";

 const App =>() {


  const read = files =>{
      files.forEach(file => {
        const fileReader = new FileReader();
        fileReader.onload = ()=>console.log(fileReader.result);
        fileReader.readAsBinaryString(file);
      });
  };
  
  return (
       <DropProvider  onDrop={read} backdrop={()=><span>Test</span>}>
          <h4>DROP HERE SOME TEXT FILE </h4>
       </DropProvider>
  );
}```
0.0.3

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.2

5 years ago

0.0.11

5 years ago

0.0.1

5 years ago