react library for uploading images
npm install react-image-uploadA react library for uploading image. Demo
 
``bash`
npm install --save react-image-upload
`jsx
import ImageUploader from 'react-image-upload'
import 'react-image-upload/dist/index.css'
const App = () => {
function getImageFileObject(imageFile) {
console.log({ imageFile })
}
function runAfterImageDelete(file) {
console.log({ file })
}
return (
onFileRemoved={(img) => runAfterImageDelete(img)}
/>
)
}
export default App
`
`jsx``
deleteIcon={
uploadIcon={
/>
| Property | Type | Default | Description |
| :------------ | :--: | -------- | ------------------------------------------------------------------------------- |
| style | obj | optional | Write your custom css |
| deleteIcon | ele | optional | The icon used to delete file |
| uploadIcon | ele | optional | The icon used to upload file |
| onFileAdded | func | required | A function that runs after file has been uploaded and returns the uploaded file |
| onFileRemoved | func | optional | A function that runs after file has been removed and returns the removed file |
MIT © chimdie