react-core-image-upload
v2.2.3
Published
a component for image to upload and crop
Downloads
133
Maintainers
Readme
react-core-image-upload
A component for image to upload and crop
Install
Use Npm
npm install react-core-image-upload --save
Use yarn
yarn add react-core-image-upload
How to use
import React from 'react';
import ReactCoreImageUpload from 'react-core-image-upload';
let App = React.createClass({
//...
render() {
return(
<div>
<ReactCoreImageUpload
text="Upload Your Image"
className='pure-button'
inputOfFile="files"
url="./api/upload.php"
imageUploaded={this.handleRes}>
</ReactCoreImageUpload>
</div>
);
},
handleRes(res) {
this.setState({
// handle response
})
}
})
Run demo
cd __sites_ && npm run start
http://localhost:9000/webpack-dev-server/demo/index.html
Props
Events
imageUploaded
: when you finish your image uploadingimageChanged
: when the input file has changedimageUploading
when your image is uploadingerrorHandle
when image uploading meet some error
Contributions
Your contributions and suggestions are welcome 😄😄😄💐💐💐