cropperj Open-Source Projects
-
-
Project mention: this.setState is not a function ( trying Upload Image) ReactJs | reddit.com/r/codehunter | 2022-05-09
Reactjs Try create upload function with cropper component. But when I try set state it says that Uncaught TypeError: this.setState is not a function at FileReader.reader.onload Component import React, { Component, PropTypes } from 'react'import { Link, browserHistory } from 'react-router'import { connect } from 'react-redux'import Cropper from 'react-cropper';class HeadPortrait extends Component { constructor(props) { super(props) this.state = { image: '', } } clickadd(e) { document.getElementById('uploadfiles').click(); } loadFile(e) { e.preventDefault(); var reader = new FileReader(); reader.onload = function () { this.setState({ image: reader.result }) }; reader.readAsDataURL(e.target.files[0]); ; }; _crop() { // image in dataUrl console.log(this.refs.cropper.getCroppedCanvas().toDataURL()); } render() { return ( Add Image Save ) }}function mapStateToProps(state) { return { // stories: state.stories }}export default connect(mapStateToProps)(HeadPortrait) Trying do like in example https://github.com/roadmanfong/react-cropper/blob/master/example/src/Demo.jsx Answer link : https://codehunter.cc/a/reactjs/this-setstate-is-not-a-function-trying-upload-image-reactjs
-
Appwrite
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
cropperjs related posts
- Cropper.js – JavaScript Image Cropper
- Hey,does somebody know the name of the plug-in to do this type of image editing?? link to their page:https://luciluciacademy.com.br/ferramentas/#
- All you need to know to deal with user avatars 👤 in React
- Tutorial Laravel Upload dengan Package ImageUp
- I need to implement a simple image rotate button before uploading to server
Index
Project | Stars | |
---|---|---|
1 | cropperjs | 10,952 |
2 | react-cropper | 1,725 |
Are you hiring? Post a new remote job listing for free.