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
- Host: GitHub
- URL: https://github.com/sarath-sasikumar/react-file-upload
- Owner: sarath-sasikumar
- Created: 2019-09-10T12:30:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-10T14:37:46.000Z (over 5 years ago)
- Last Synced: 2023-09-19T15:51:08.167Z (over 1 year ago)
- Language: JavaScript
- Size: 190 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
}
```