mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 21:59:41 +08:00
ee50fe7952
* refactor(upload): rewrite with hooks * refactor: optimize code style; chore(dragger): add forwardRef; * fix: lint * fix: trigger ci * fix: lint * chore: add test case
19 lines
527 B
TypeScript
19 lines
527 B
TypeScript
import * as React from 'react';
|
|
import Upload from './Upload';
|
|
import { UploadProps } from './interface';
|
|
|
|
export type DraggerProps = UploadProps & { height?: number };
|
|
|
|
const InternalDragger: React.ForwardRefRenderFunction<unknown, DraggerProps> = (
|
|
{ style, height, ...restProps },
|
|
ref,
|
|
) => {
|
|
return <Upload ref={ref} {...restProps} type="drag" style={{ ...style, height }} />;
|
|
};
|
|
|
|
const Dragger = React.forwardRef(InternalDragger) as React.FC<DraggerProps>;
|
|
|
|
Dragger.displayName = 'Dragger';
|
|
|
|
export default Dragger;
|