Skip to content

sarath-sasikumar/react-file-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-file-upload

This is a simple react component which can be used to make any element file uploadable on click.

Setup

Install the package

npm i react-file-upload

Usage

Import the component from the package

import { FileUpload } from 'react-file-upload'

Wrap the component around any element which needs show the option to upload file when clicked.

<FileUpload onFileUpload={this.onFileUpload}>
<!-- Any element-->
</FileUpload>

The function onFileUpload will have the file param which is the uploaded file object

onFileUpload=(file)=>{
// Call service to upload file
}

About

React Component to make any element file uploadable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published