Closed LeoEatle closed 6 years ago
I use it like this:
<Cropper ref={ ref => { this.cropper = ref }} src={this.state.tempPic} width={540} height={540} ratio={1 / 1} fixedRatio={true} onChange={this.CropperChange} > </Cropper>
But I get this error:
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Is there anything wrong with my usage or a bug?
Get the answer. This component is not exported as default. So use import {Cropper} from 'react-image-cropper' then everything is ok. Closed. ;)
import {Cropper} from 'react-image-cropper'
I use it like this:
But I get this error:
Is there anything wrong with my usage or a bug?