An open API service indexing awesome lists of open source software.

https://github.com/sarath-sasikumar/react-file-upload

React Component to make any element file uploadable
https://github.com/sarath-sasikumar/react-file-upload

Last synced: 2 months ago
JSON representation

React Component to make any element file uploadable

Awesome Lists containing this project

README

        

# 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.

```

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

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