mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
fix: Form.Item warning for initialValue (#23846)
* fix: Form.Item warning for initialValue * Update index.test.js * Update index.test.js
This commit is contained in:
parent
72bb377628
commit
e15773e25b
@ -184,6 +184,7 @@ function FormItem(props: FormItemProps): React.ReactElement {
|
||||
'help',
|
||||
'htmlFor',
|
||||
'id', // It is deprecated because `htmlFor` is its replacement.
|
||||
'initialValue',
|
||||
'label',
|
||||
'labelAlign',
|
||||
'labelCol',
|
||||
|
@ -694,4 +694,15 @@ describe('Form', () => {
|
||||
wrapper.update();
|
||||
expect(wrapper.find('.ant-form-item').last().hasClass('ant-form-item-with-help')).toBeFalsy();
|
||||
});
|
||||
|
||||
it('no warning of initialValue', () => {
|
||||
mount(
|
||||
<Form>
|
||||
<Form.Item initialValue="bamboo">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Form>,
|
||||
);
|
||||
expect(errorSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user