mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
Updating document to correct few typos (#22902)
This commit is contained in:
parent
e852433ef3
commit
d45d4bbd28
@ -5,7 +5,7 @@ skip: true
|
|||||||
|
|
||||||
### Remove Form.create
|
### Remove Form.create
|
||||||
|
|
||||||
Form of v4 is not need create context by `Form.create()`. Form is now have own data scope and you don't need `getFieldDecorator` anymore. Just use Form.Item directly:
|
Form of v4 does not need to create context by calling `Form.create()`. Form now has it's own data scope and you don't need `getFieldDecorator` anymore. Just use Form.Item directly:
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
// antd v3
|
// antd v3
|
||||||
@ -35,7 +35,7 @@ const Demo = () => (
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
Since `Form.create()` is removed, origin `onFieldsChange` or other methods moved to Form, and control by `fields`. ref [example](/components/form/#components-form-demo-global-state)。
|
Since `Form.create()` is removed, methods like `onFieldsChange` have moved to `Form` and form state is controlled by a `fields` prop. ref [example](/components/form/#components-form-demo-global-state)。
|
||||||
|
|
||||||
### Form control
|
### Form control
|
||||||
|
|
||||||
@ -140,11 +140,11 @@ const Demo = () => {
|
|||||||
|
|
||||||
### Linkage with field
|
### Linkage with field
|
||||||
|
|
||||||
New Form use incremental update which only update related field. So if there are some linkage between fields or update with whole form. You can use [`dependencies`](/components/form/#dependencies) or [`shouldUpdate`](/components/form/#shouldUpdate) to handle that.
|
New Form uses incremental update which only updates related field. So if there is some linkage between fields or updates with the whole form, you can use [`dependencies`](/components/form/#dependencies) or [`shouldUpdate`](/components/form/#shouldUpdate) to handle that.
|
||||||
|
|
||||||
### replace onSubmit with onFinish
|
### replace onSubmit with onFinish
|
||||||
|
|
||||||
You need to listen `onSubmit` and call `validateFields` to handle validation in old Form. New Form provides `onFinish` which only trigger when validation is passed:
|
You need to listen to `onSubmit` and call `validateFields` to handle validation in old Form. New Form provides `onFinish` which will only trigger when validation has passed:
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
// antd v3
|
// antd v3
|
||||||
@ -193,7 +193,7 @@ const Demo = () => {
|
|||||||
|
|
||||||
## Replace validateFieldsAndScroll with scrollToField
|
## Replace validateFieldsAndScroll with scrollToField
|
||||||
|
|
||||||
New version recommend use `onFinish` for submit after validation. Thus `validateFieldsAndScroll` is change to more flexible method `scrollToField`:
|
New version recommend use `onFinish` for submit after validation. Thus `validateFieldsAndScroll` is changed to more flexible method `scrollToField`:
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
// antd v3
|
// antd v3
|
||||||
|
Loading…
Reference in New Issue
Block a user