Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@logicamente.info/react-drop-component

1.0.4 • Public • Published

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

Name Description Default
onDrop (required) called when a file is dropped or selected. Signature: (file: HTML5File, text: String)
handleClick Handle click events on the rendered component true
dontRead Prevent reading the file content, if it's causing problems false
label Label on the component Select or Drop your file here
multiple Allows user to select or drop multiple files for each input false
accept File 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.

Install

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

DownloadsWeekly Downloads

4

Version

1.0.4

License

MIT

Unpacked Size

17.6 kB

Total Files

10

Last publish

Collaborators

  • avatar