fix: dropzone error on image upload component (#1711)

This commit is contained in:
Nan Yu 2020-12-08 19:32:41 -08:00 committed by GitHub
parent 63d926e196
commit 9e1f31e14c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -28,7 +28,7 @@ class ImageUpload extends React.Component<Props> {
@observable isUploading: boolean = false;
@observable isCropping: boolean = false;
@observable zoom: number = 1;
file: File;
@observable file: File;
avatarEditorRef: AvatarEditor;
static defaultProps = {
@ -128,7 +128,12 @@ class ImageUpload extends React.Component<Props> {
style={EMPTY_OBJECT}
disablePreview
>
{this.props.children}
{({ getRootProps, getInputProps, isDragActive }) => (
<div {...getRootProps()} {...{ isDragActive }}>
<input {...getInputProps()} />
{this.props.children}
</div>
)}
</Dropzone>
);
}