diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index 96f8a69d6484..ef94f43652c5 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -57,18 +57,12 @@ The following `options` are available: | validateMessages | Default validate message. And its format is similar with [newMessages](https://github.com/yiminghe/async-validator/blob/master/src/messages.js)'s returned value | Object { [nested.path]: String } | | onFieldsChange | Specify a function that will be called when the value a `Form.Item` gets changed. Usage example: saving the field's value to Redux store. | Function(props, fields) | | onValuesChange | A handler while value of any field is changed | (props, changedValues, allValues) => void | -| withRef | Whether `refs` contain `wrappedComponent` | boolean | -If you want to get `ref` after `Form.create`, you can use `withRef` or `wrappedComponentRef` provided by `rc-form`,[details can be viewed here](https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140). +If you want to get `ref` after `Form.create`, you can use `wrappedComponentRef` provided by `rc-form`,[details can be viewed here](https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140). ```jsx class CustomizedForm extends React.Component { ... } -// use withRef -const EnhancedForm = Form.create({ withRef: true })(CustomizedForm); - this.form = form} /> -this.form.refs.wrappedComponent // => The instance of CustomizedForm - // use wrappedComponentRef const EnhancedForm = Form.create()(CustomizedForm); this.form = form} /> diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index 2b5c075846fc..a477daec8d7a 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -59,18 +59,12 @@ CustomizedForm = Form.create({})(CustomizedForm); | validateMessages | 默认校验信息,可用于把默认错误信息改为中文等,格式与 [newMessages](https://github.com/yiminghe/async-validator/blob/master/src/messages.js) 返回值一致 | Object { [nested.path]: String } | | onFieldsChange | 当 `Form.Item` 子节点的值发生改变时触发,可以把对应的值转存到 Redux store | Function(props, fields) | | onValuesChange | 任一表单域的值发生改变时的回调 | (props, changedValues, allValues) => void | -| withRef | `refs` 中是否有 `wrappedComponent` | boolean | -经过 `Form.create` 之后如果要拿到 `ref`,可以使用 `withRef` 也可以使用 `rc-form` 提供的 `wrappedComponentRef`,[详细内容可以查看这里](https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140)。 +经过 `Form.create` 之后如果要拿到 `ref`,可以使用 `rc-form` 提供的 `wrappedComponentRef`,[详细内容可以查看这里](https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140)。 ```jsx class CustomizedForm extends React.Component { ... } -// use withRef -const EnhancedForm = Form.create({ withRef: true })(CustomizedForm); - this.form = form} /> -this.form.refs.wrappedComponent // => The instance of CustomizedForm - // use wrappedComponentRef const EnhancedForm = Form.create()(CustomizedForm); this.form = form} />