1.0.4 • Published 4 years ago

@logicamente.info/react-drop-component v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

DropComponent

This is a direct modification of Romgrk's DropZone for better management of the component and handling of files.

Install

npm i -S @logicamente.info/react-drop-component

How to use

import { DropComponent } from '@logicamente.info/react-drop-component'

<DropComponent onDrop={(file, text) => console.log(file, text)} />

Props

NameDescriptionDefault
onDrop (required)called when a file is dropped or selected. Signature: (file: HTML5File, text: String)
handleClickHandle click events on the rendered componenttrue
dontReadPrevent reading the file content, if it's causing problemsfalse
labelLabel on the componentSelect or Drop your file here
multipleAllows user to select or drop multiple files for each inputfalse
acceptFile types that user can drop or pick from the file input dialog box*

Details

The component overwrites the onDrag/DragEnter/.../Drop props of the render function child.