2017-11-17 14:38:54 +08:00
|
|
|
import * as React from 'react';
|
2017-03-17 11:47:05 +08:00
|
|
|
import Upload from './Upload';
|
|
|
|
import { UploadProps } from './interface';
|
|
|
|
|
|
|
|
export type DraggerProps = UploadProps & { height?: number };
|
|
|
|
|
2019-09-17 14:43:08 +08:00
|
|
|
// stick class comoponent to avoid React ref warning inside Form
|
|
|
|
// https://github.com/ant-design/ant-design/issues/18707
|
2019-09-17 14:49:34 +08:00
|
|
|
// eslint-disable-next-line react/prefer-stateless-function
|
2019-09-17 14:43:08 +08:00
|
|
|
export default class Dragger extends React.Component<DraggerProps, any> {
|
|
|
|
render() {
|
2020-05-16 14:25:49 +08:00
|
|
|
const { style, height, ...restProps } = this.props;
|
|
|
|
return <Upload {...restProps} type="drag" style={{ ...style, height }} />;
|
2019-09-17 14:43:08 +08:00
|
|
|
}
|
|
|
|
}
|