fix(upload): props type declaration (#26347)

* fix(upload): props  type declaration

* fix lint

* chore: add type test case
This commit is contained in:
Kermit Xuan 2020-08-23 22:46:55 +08:00 committed by GitHub
parent 71bdb0ab33
commit d8215589de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -338,7 +338,9 @@ const InternalUpload: React.ForwardRefRenderFunction<unknown, UploadProps> = (pr
};
interface CompoundedComponent
extends React.ForwardRefExoticComponent<UploadProps & React.RefAttributes<any>> {
extends React.ForwardRefExoticComponent<
React.PropsWithChildren<UploadProps> & React.RefAttributes<any>
> {
Dragger: typeof Dragger;
}

View File

@ -0,0 +1,13 @@
import React from 'react';
import Upload from '..';
describe('Upload.typescript', () => {
it('Upload', () => {
const upload = (
<Upload>
<span>click to upload</span>
</Upload>
);
expect(upload).toBeTruthy();
});
});