chore: Fix TS define of FormItem (#21067)

This commit is contained in:
二货机器人 2020-01-22 11:33:35 +08:00 committed by GitHub
parent 1fc5572c3b
commit ee6f63f2e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View File

@ -40,7 +40,7 @@ export interface FormItemProps
fieldKey?: number;
}
function FormItem(props: FormItemProps): React.ReactNode {
function FormItem(props: FormItemProps): React.ReactElement {
const {
name,
fieldKey,
@ -98,7 +98,7 @@ function FormItem(props: FormItemProps): React.ReactNode {
fieldId?: string,
meta?: Meta,
isRequired?: boolean,
) {
): any {
if (noStyle) {
return baseChildren;
}

View File

@ -0,0 +1,17 @@
/* eslint-disable no-unused-expressions */
import * as React from 'react';
import Form from '..';
import Input from '../../input';
describe('Form.typescript', () => {
it('Form.Item', () => {
<Form>
<Form.Item name="test">
<Input />
</Form.Item>
</Form>;
});
});
/* eslint-enable */