# react-dropzone-component
**Repository Path**: mirrors_fis-components/react-dropzone-component
## Basic Information
- **Project Name**: react-dropzone-component
- **Description**: Fork from https://github.com/felixrieseberg/React-Dropzone.git
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-08
- **Last Updated**: 2026-05-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## Dropzone.js Component for React
[](https://travis-ci.org/felixrieseberg/React-Dropzone-Component) [](https://david-dm.org/felixrieseberg/react-dropzone-component) [](https://badge.fury.io/js/react-dropzone-component) 
A dropzone component for ReactJS, allowing users to "drag and drop" files into an upload area. The component uses the battle-tested [Dropzone.js](http://www.dropzonejs.com/) to provide a cross-browser-compatible upload component.
You [can see a demo of the uploader with minimal configuration here](http://reactdropzone.azurewebsites.net/example).
* [Simple Usage Example](#usage)
* [Accessing the Dropzone.js object](#accessing-the-dropzone-object)
* [Usage without automatic posting](#usage-without-automatic-posting)
* [Custom Preview Template](#custom-preview-template)
* [Custom Post Parameters](#custom-post-parameters)
* [Updating the Component's Properties](#updating-the-components-properties)
* [Callbacks](#callbacks)
* [Server Example](#server-example)
## Usage
The component is initialized with a configuration object. Optional are a list of event handlers and a configuration object for dropzone.js.
If you are using one of the many module solutions, you can simply install and require this component like shown below. The package's main entry point is `lib/dropzone.js`, which gives you all the dropzone components. If you're rolling with ES6/ES2015, feel free to use `src/dropzone.js`. If you don't want any trouble at all, just add `dist/dropzone.min.js` as a script to your app and use ``.
Please ensure that you also include two required CSS files: `styles/filepicker.css` and `node_modules/dropzone/dist/min/dropzone.min.css`. There are currently a bunch of good ways to combine and process CSS in React, so I'll leave it to you to choose whatever method is best for you - the component does not automatically load CSS.
```
npm install react-dropzone-component
```
```js
var React = require('react');
var DropzoneComponent = require('react-dropzone-component');
React.render(
,
document.getElementById('content')
);
```
The configuration allows you to disable the display of CSS file type icons and to set the URL to which uploads should be posted.
```js
var componentConfig = {
iconFiletypes: ['.jpg', '.png', '.gif'],
showFiletypeIcon: true,
postUrl: '/uploadHandler'
};
```
##### Accessing the Dropzone Object
There are a bunch of operations that might require accessing the dropzone object, especially when wanting to call [dropzone methods](http://www.dropzonejs.com/#dropzone-methods).
To get said object, use the `init` event, whose callback will receive a reference to the dropzone object as a parameter.
```JS
var myDropzone;
function initCallback (dropzone) {
myDropzone = dropzone;
}
function removeFile () {
if (myDropzone) {
myDropzone.removeFile();
}
}
```
##### Usage Without Automatic Posting
If you want to use this component without posting automatically to a URL but instead do the posting yourself, then you can just leave the `postUrl` option empty and handle the displaying of progress by yourself using the provided event handlers. In this case, Dropzone.js requires that the Dropzone Component is creates as a `