0.1.6 • Published 8 years ago

react-file-drag-and-drop v0.1.6

Weekly downloads
222
License
MIT
Repository
github
Last release
8 years ago

React File Drag and Drop Component

A simple React component that handles file drag and drop.

Install

npm install --save react-file-drag-and-drop

How to use

var FileDragAndDrop = require('react-file-drag-and-drop');

var style = {
  width: '100px',
  height: '100px'
};

var Example = React.createClass({

  handleDrop: function (dataTransfer) {
    var files = dataTransfer.files;

    // Do something with dropped files...
  },

  render: function () {
    return (
      <div>
        <h1>Please drop your files</h1>
        <div style={style}>
          <FileDragAndDrop onDrop={this.handleDrop}>
            Drop files here...
          </FileDragAndDrop>
        </div>
      </div>
    );
  }
});

module.exports = Example;
0.1.6

8 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.0

9 years ago