Skip to content

Commit

Permalink
Updating document to correct few typos (ant-design#22902)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanBagchi authored Apr 3, 2020
1 parent e852433 commit d45d4bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/form/v3.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ skip: true

### 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
// antd v3
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -140,11 +140,11 @@ const Demo = () => {

### 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

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
// antd v3
Expand Down Expand Up @@ -193,7 +193,7 @@ const Demo = () => {

## 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
// antd v3
Expand Down

0 comments on commit d45d4bb

Please sign in to comment.