docs: update docs for Form, ref: #2591

This commit is contained in:
Benjy Cui 2016-08-03 10:55:15 +08:00
parent c04ba5b39b
commit 5b5439208c
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ If the form has been decorated by `Form.create` then it has `this.props.form` pr
#### Special attention
Can't use `getFieldProps` in functional components: https://github.com/facebook/react/pull/6534
If you use `react@<15.3.0`, then, you can't use `getFieldProps` in functional components: https://github.com/facebook/react/pull/6534
The return value of `getFieldProps` contains `id`、`value`(or any other props `valuePropName` that you specified),`ref`,`onChange`(or any other `trigger` `validateTrigger` that you specified), **shouldn't set same property again** in order to avoid conflict. If you concerntate on the details on return value, you can print them to console by `console.log`.

View File

@ -80,7 +80,7 @@ CustomizedForm = Form.create({})(CustomizedForm);
#### 特别注意
`getFieldProps` 调用不能位于纯函数组件中: https://github.com/facebook/react/pull/6534
如果使用的是 `react@<15.3.0`,则 `getFieldProps` 调用不能位于纯函数组件中: https://github.com/facebook/react/pull/6534
`getFieldProps` 返回的属性包括 `id`、`value`(或你设置的其它 `valuePropName`)、`ref`、`onChange`(或者你设置的其它 `trigger` `validateTrigger`**所以不应再设置同样的属性**,以免冲突。如果对其返回值的细节有兴趣,可以 `console.log` 出来查看。