Each child in an array or iterator should have a unique "key" prop. Check the render method of `Tabl

Each child in an array or iterator should have a unique "key" prop. Check the render method of `Tabl

Child Array or AN in each Iterator Should have have A UNIQUE "Key" prop. The Check The Method of the render ` the Table the Cell `

In the process of using ant, I believe that many people will encounter this error.

The solution needs to be based on the no longer scenario, only one principle is followed, setting the key value,

In the table: rowKey needs to be set, if there is no id in the dataSource, the value of rowKey needs to be set to point to unique.

The key value also needs to be set in the option, such as: there is a piece of data

const menuItem = [
  {
    value:'0',
    text:'Project Attendance'
  },
  {
    value:'1',
    text:'Spring Festival holiday'
  },
  {
    value:'2',
    text:'Spring Festival Standby'
  },
  {
    value:'3',
    text:'Paid leave (marriage/mourning/visiting/relative)'
  },
  {
    value:'4',
    text:'paid sick leave'
  },
  {
    value:'5',
    text:'personal leave'
  },
  {
    value:'6',
    text:'Absenteeism'
  },
];

When doing the loop, you need to set the key value, otherwise an error will be reported, you can do this,

<Select style={{ width: 80 }} onChange={this.fatherSelectChange.bind(this)}>
            {menuItem.map((item,index) =>{
              return(
                <Option key={index} value={item.value}>{item.text}</Option>
              )
            })}
          </Select>

Great gods from all walks of life are welcome to come to guide, and if you have any questions, you can also leave a message below.

Reference:https://cloud.tencent.com/developer/article/1148189 Each child in an array or iterator should have a unique "key" prop. Check the render method of `Tabl-Cloud + Community-Tencent Cloud