update changelog for getFieldDecorator

This commit is contained in:
afc163 2016-09-29 13:43:04 +08:00
parent 2875d024f9
commit ce894a60ae
2 changed files with 14 additions and 10 deletions

View File

@ -61,14 +61,16 @@ There are some breaking changes in `antd@2.0.0`, and you need to modify your cod
The following change will throw some warnings in the console and it will still work, but we recommend to update your code.
* `getFieldProps` of Form is deprecated, please use `getFieldDecorator`:
```diff
+ getFieldDecorator('userName', { ... })(
<Input placeholder="请输入账户名"
- {...getFieldProps('userName', { ... })}
/>
+ )
- <Input placeholder="text" {...getFieldProps('userName', { ... })} />
+ {getFieldDecorator('userName', { ... })(
+ <Input placeholder="text" />
+ )}
```
* `toggleOpen` of DatePicker is deprecated, please use `onOpenChange`:
```diff
- handleToggleOpen({ open }) {
+ handleOpenChange(open) {

View File

@ -59,14 +59,16 @@ timeline: true
以下变化升级后旧代码仍然能正常运行,但是控制台会出现警告提示,建议按提示进行修改。
* Form 废弃 `getFieldProps`,请使用 `getFieldDecorator`
```diff
+ getFieldDecorator('userName', { ... })(
<Input placeholder="请输入账户名"
- {...getFieldProps('userName', { ... })}
/>
+ )
- <Input placeholder="text" {...getFieldProps('userName', { ... })} />
+ {getFieldDecorator('userName', { ... })(
+ <Input placeholder="text" />
+ )}
```
* DatePicker 废弃 `toggleOpen`,请使用 `onOpenChange`
```diff
- handleToggleOpen({ open }) {
+ handleOpenChange(open) {