# react-x-file-uploader

> Simple react file uploader component for viewing and getting data from files

Latest version **1.0.26** (published 2019-03-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-x-file-uploader
pnpm add react-x-file-uploader
yarn add react-x-file-uploader
bun add react-x-file-uploader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.26 |
| Published | 2019-03-04 |
| First published | 2019-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 542.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | abhinavcreed13 |

## Links

- npm: https://www.npmjs.com/package/react-x-file-uploader
- npm.io page: https://npm.io/package/react-x-file-uploader

## Dependencies (4)

- [csv](https://npm.io/package/csv.md) ^5.1.1
- [mdbreact](https://npm.io/package/mdbreact.md) ^4.11.0
- [classnames](https://npm.io/package/classnames.md) latest
- [react-dropzone](https://npm.io/package/react-dropzone.md) ^9.0.0

## Recent versions

- 1.0.26 (latest) — 2019-03-04
- 1.0.25 — 2019-03-04
- 1.0.24 — 2019-03-04
- 1.0.23 — 2019-03-04
- 1.0.22 — 2019-03-04
- 1.0.21 — 2019-03-04
- 1.0.2 — 2019-03-04
- 1.0.0 — 2019-03-04

## README

## React File Uploader

[![NPM](https://nodei.co/npm/react-x-file-uploader.png)](https://nodei.co/npm/react-x-file-uploader/)

### Installation

`npm install --save react-x-file-uploader`

### How To Use

First import this component where you want to use it

`import FileUploader from 'react-x-file-uploader';`

Then just renders it

`<FileUploader type='CSV' onUpload={this.onUploadHandler}/>`

### Props

| _Prop_ |     _Description_     
| ------ | :-------------------: 
| type  | Sets type of file uploader 
| onUpload  |      Sets subscribing function to provide read data

### Supported Types

- CSV

### Example

```
import React, { Component } from 'react';
import FileUploader from 'react-x-file-uploader';

class App extends Component {
  
  onUploadHandler = (data) => {
    console.log("Parent->" + data);
  }
  
  render() {
    return (
        <div className="datasourcecontrol">
            <FileUploader type='CSV' onUpload={this.onUploadHandler}/>
        </div>
    );
  }
}

export default App;
```

Intially, drag-drop UI is created for dropping or choosing file.

![Alt text](https://raw.githubusercontent.com/abhinavcreed13/react-x-file-uploader/master/img/drag_drop.png "Drag-Drop UI")

After file is selected, preview of the data is shown and subscribed event is triggered.

![Alt text](https://raw.githubusercontent.com/abhinavcreed13/react-x-file-uploader/master/img/csv_data_sample.png "Preview of CSV data")

---
_Source: https://npm.io/package/react-x-file-uploader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
