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:
二货机器人 2020-05-04 12:13:44 +08:00 committed by GitHub
parent 72bb377628
commit e15773e25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -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',

View File

@ -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();
});
});