Each child in an array or iterator should have a unique "key" prop. Check the render method of `Tabl
2017-09-09 00:00
483 查看
Each child in an array or iterator should have a unique "key" prop. Check the render method of `Table Cell`
在使用ant的过程中,我相信有很多人都会遇到这个错误,
解决方式需要根据不再的场景来,遵循的只有一个原则,设置key值,
在table中:需要设置rowKey,如果dataSource中没有id的话,需要设置rowKey的值指向唯一.
在option中也 需要设置key值的,比如:有一段数据
在做循环的时候,需要设置key值,不然会报错,可以这样做,
欢迎各界大神前来指导,有问题也可以在下方留言交流.
在使用ant的过程中,我相信有很多人都会遇到这个错误,
解决方式需要根据不再的场景来,遵循的只有一个原则,设置key值,
在table中:需要设置rowKey,如果dataSource中没有id的话,需要设置rowKey的值指向唯一.
在option中也 需要设置key值的,比如:有一段数据
const menuItem = [ { value:'0', text:'项目出勤' }, { value:'1', text:'春节放假' }, { value:'2', text:'春节待命' }, { value:'3', text:'带薪假(婚/丧/探/亲)' }, { value:'4', text:'带薪病假' }, { value:'5', text:'事假' }, { value:'6', text:'旷工' }, ];
在做循环的时候,需要设置key值,不然会报错,可以这样做,
<Select style={{ width: 80 }} onChange={this.fatherSelectChange.bind(this)}> {menuItem.map((item,index) =>{ return( <Option key={index} value={item.value}>{item.text}</Option> ) })} </Select>
欢迎各界大神前来指导,有问题也可以在下方留言交流.
相关文章推荐
- Warning: Each child in an array or iterator should have a unique "key" prop. Check the render ...
- Warning: Each child in an array or iterator should have a unique “key” prop. Check the render method
- react Warning: Each child in an array or iterator should have a unique "key" prop. Check the render
- react-native中debug报错信息:Each child in an array or iterator should have a unique "key" prop.
- React总结7:Each child in an array or iterator should have a unique "key" prop.的处理方法
- Warning: Each child in an array or iterator should have a unique "key" prop.
- Warning: Each child in an array or iterator should have a unique "key" prop.
- ReactNativeiOS(三)开发零碎3 warning: Each child in ar array or integrator should have a unique "key" prop
- Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.
- ant-design Warning: Each record in table should have a unique `key` prop,or set `rowKey` to an un
- ReactJs 报错 Element type is invalid: expected a string (from built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `Me`.
- "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."
- The method below converts an array of objects to a DataTable object in C#.
- Err:The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array
- How to limit an array of similar hashes to those that have more than one of the same key:value pair
- MySql-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v
- [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s
- 奇葩问题:This file could not be checked in because the original version of the file on the server was moved or deleted. A new version of this file has been saved to the server, but your check-in comments were not saved
- FAQ(67):java.sql.SQLException: You have an error in your SQL syntax; check the manual that correspon
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your