ant-design/components/upload/Dragger.tsx
偏右 a820046130
fix: Upload.Dragger triggered by label when disabled (#24202)
* refactor Dragger.tsx

* 🐛 Avoid disabled Upload.Dragger being triggered by label

close #24197
2020-05-16 14:25:49 +08:00

16 lines
580 B
TypeScript

import * as React from 'react';
import Upload from './Upload';
import { UploadProps } from './interface';
export type DraggerProps = UploadProps & { height?: number };
// stick class comoponent to avoid React ref warning inside Form
// https://github.com/ant-design/ant-design/issues/18707
// eslint-disable-next-line react/prefer-stateless-function
export default class Dragger extends React.Component<DraggerProps, any> {
render() {
const { style, height, ...restProps } = this.props;
return <Upload {...restProps} type="drag" style={{ ...style, height }} />;
}
}