Error: must set key for <rc-animate> children
发布时间:2020-12-15 06:38:17 所属栏目:百科 来源:网络整理
导读:在使用antd-design中的select的组件时候,报了这样的一个错误: Error: must set key for rc-animate children FormItem {...formItemLayout} label={item.label} key={index} { getFieldDecorator(item.paramName,{ initialValue: [],})( Select size={config
在使用antd-design中的select的组件时候,报了这样的一个错误: Error: must set key for <rc-animate> children <FormItem {...formItemLayout} label={item.label} key={index}> { getFieldDecorator(item.paramName,{ initialValue: [],})( <Select size={config.size} showSearch mode="multiple" optionFilterProp="children" > { item.options.map(option => { return ( <Select.Option key={option.value} value={Util.numToString(option.value)} > {option.text} </Select.Option> ) }) } </Select> ) } </FormItem> 原因是我在select中设置了mode = 'multiple',并把initialValue的值设为了[''],便报了这样的错误了. 解决文案:只需要把initialValue的值默认设为空,或者设为不是空字符串的文字 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Play!2.1 提示信息flash的使用
- winforms – 以编程方式打开DateTimePicker C#控件
- c – 是否定义了静态初始化实现的顺序?
- 正则表达式的非捕获组
- postgresql – 根据查询结果将值设置为变量(PL / pgSQL样式
- c# – DirectoryInfo.EnumerateFiles(…)导致UnauthorizedA
- react-router4 实现按需加载 实现按需加载后 引起 没法获取
- 怎样查看oracle当前的连接数
- No rule to make target cocos2d/cocos/editor-support/coc
- ajax以base64上传图片到django