antd From 表单报错:warning.js:6 Warning: [antd: Switch] value is not validate prop, do you mean checked?
<FormItem label="开关">
{getFieldDecorator('switch', {
})(<Switch onChange={this.onChange} />)}
</FormItem>
查看文档得知 Switch 组件是通过 checked 的属性来显示状态的,所以添加一个额外的属性 valuePropName
<FormItem label="开关">
{getFieldDecorator('switch', {
valuePropName: 'checked'
})(<Switch onChange={this.onChange} />)}
</FormItem>