🐛 revert to class component to avoid ref warning

close #18707
This commit is contained in:
afc163 2019-09-17 14:43:08 +08:00
parent 7404a7ea32
commit d72f825f43

View File

@ -4,8 +4,11 @@ import { UploadProps } from './interface';
export type DraggerProps = UploadProps & { height?: number };
const Dragger: React.FC<DraggerProps> = props => (
<Upload {...props} type="drag" style={{ ...props.style, height: props.height }} />
);
export default Dragger;
// stick class comoponent to avoid React ref warning inside Form
// https://github.com/ant-design/ant-design/issues/18707
export default class Dragger extends React.Component<DraggerProps, any> {
render() {
const { props } = this;
return <Upload {...props} type="drag" style={{ ...props.style, height: props.height }} />;
}
}