mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-05 15:39:45 +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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
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