1.0.26 • Published 5 years ago

react-x-file-uploader v1.0.26

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

React File Uploader

NPM

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

PropDescription
typeSets type of file uploader
onUploadSets 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

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

Alt text

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.2

5 years ago

1.0.0

5 years ago