mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
chore: Fix TS define of FormItem (#21067)
This commit is contained in:
parent
1fc5572c3b
commit
ee6f63f2e1
@ -40,7 +40,7 @@ export interface FormItemProps
|
|||||||
fieldKey?: number;
|
fieldKey?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
function FormItem(props: FormItemProps): React.ReactNode {
|
function FormItem(props: FormItemProps): React.ReactElement {
|
||||||
const {
|
const {
|
||||||
name,
|
name,
|
||||||
fieldKey,
|
fieldKey,
|
||||||
@ -98,7 +98,7 @@ function FormItem(props: FormItemProps): React.ReactNode {
|
|||||||
fieldId?: string,
|
fieldId?: string,
|
||||||
meta?: Meta,
|
meta?: Meta,
|
||||||
isRequired?: boolean,
|
isRequired?: boolean,
|
||||||
) {
|
): any {
|
||||||
if (noStyle) {
|
if (noStyle) {
|
||||||
return baseChildren;
|
return baseChildren;
|
||||||
}
|
}
|
||||||
|
17
components/form/__tests__/type.test.tsx
Normal file
17
components/form/__tests__/type.test.tsx
Normal 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 */
|
Loading…
Reference in New Issue
Block a user