react-fileupload React component
npm install @99xt/react-fileupload

Simpler file upload implementation for react.js apps.
To install this library, run:
``bash`
npm install @99xt/react-fileupload --save
example.component.js
`
import React, {Component} from 'react';
import FileUpload from '@99xt/react-fileupload';
class ExampleApp extends Component {
onUploadFiles(evt) {
if (evt.error) {
throw evt.error;
}
const files = evt.files;
// You can run upload script here
console.log(files);
}
render() {
const allowedTypes = [];
const allowedSize = 15; // MB
const multiple = true;
return (
{ / with default UI / }
allowedSize={ allowedSize }
multiple={ multiple }
onUploadFiles={ this.onUploadFiles }
/>
{ / with custom UI / }
allowedSize={allowedSize}
multiple={multiple}
onUploadFiles={this.onUploadFiles}
renderUI={props => {
const { status } = props;
return (
Click or drag n drop your file(s) here.
Drag n drop status: {status}
Contributing Guide
$3
Clone the repository to your workstation
`bash
git clone git@github.com:99xt/react-fileupload.git
`Navigate to the project directory
`bash
cd react-fileupload
`
`bash
npm install
npm run build
`Use
npm run clean for delete built resources.$3
`
npm start
`Demo app will start on http://localhost:3000
$3
Update the version in
package.json;`
npm publish
``MIT