Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

需要遍历数组去确定每一列,Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `Picker`. #1238

Closed
itxuye opened this issue Apr 28, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@itxuye
Copy link

commented Apr 28, 2017

Version

1.1.0

Environment

MacOS Chrome

Reproduction link

Steps to reproduce

需要遍历数组去确定每一列,Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of Picker.

datas.map((data, i) => {
if (columnType == 'department') {
      return                             
                                      <Picker cols={1}
                                         key={i}
                                         {...getFieldProps(applicationColumnName, {
                                           rules: [{required: isRequired}],
                                           initialValue: departmentValue
                                         })}
                                         data={departmentArray}>
              <List.Item arrow="horizontal">{data.end_user_column_name}</List.Item>
            </Picker>
}
}

What is actually happening?

key已经加了,用的index,只有在选择的时候才会有这种问题,所以不清楚这个key怎么加

@itxuye itxuye changed the title 需要便利数组去确定每一列,Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `Picker`. 需要遍历数组去确定每一列,Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `Picker`. Apr 28, 2017

@itxuye

This comment has been minimized.

Copy link
Author

commented Apr 28, 2017

尝试在外面套上加上key也是报同样的问题

@ant-design-bot

This comment has been minimized.

Copy link

commented Apr 28, 2017

Hello @itxuye. Please provide a re-producible demo: http://codepen.io/paranoidjk/pen/LWpaKe

@itxuye

This comment has been minimized.

Copy link
Author

commented Apr 28, 2017

@paranoidjk 这是我的问题,非常不好意思。使用过程中,因为有重复的type_id导致了

@itxuye itxuye closed this Apr 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.