{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/3766","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/3766/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/3766/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/3766/events","html_url":"https://github.com/ant-design/ant-design/issues/3766","id":188017030,"number":3766,"title":"Encountered two children with the same key, `.${elem}`. Child keys must be unique; when two children share a key, only the first child will be used","user":{"login":"pavilionking","id":5700345,"avatar_url":"https://avatars.githubusercontent.com/u/5700345?v=3","gravatar_id":"","url":"https://api.github.com/users/pavilionking","html_url":"https://github.com/pavilionking","followers_url":"https://api.github.com/users/pavilionking/followers","following_url":"https://api.github.com/users/pavilionking/following{/other_user}","gists_url":"https://api.github.com/users/pavilionking/gists{/gist_id}","starred_url":"https://api.github.com/users/pavilionking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavilionking/subscriptions","organizations_url":"https://api.github.com/users/pavilionking/orgs","repos_url":"https://api.github.com/users/pavilionking/repos","events_url":"https://api.github.com/users/pavilionking/events{/privacy}","received_events_url":"https://api.github.com/users/pavilionking/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-08T15:11:55Z","updated_at":"2016-11-24T13:51:28Z","closed_at":"2016-11-11T01:43:30Z","body":"<!-- Issue Template -->\r\n\r\n<!--\r\nantd 的用法咨询，建议通过以下渠道，官方 issues 目前没有足够精力提供此类咨询服务：\r\n\r\n1. [Stack Overflow](http://stackoverflow.com/questions/tagged/antd)\r\n2. [Segment Fault](https://segmentfault.com/t/antd)（中文）\r\n3. [Gitter](https://gitter.im/ant-design/ant-design)\r\n\r\n如果是报告 bug，请按照下列格式书写，并务必提供复现步骤，否则恕难解决，感谢您的支持。\r\n-->\r\n\r\n#### 发生问题的环境是：\r\n\r\n<!-- 务必提供 -->\r\n\r\n- antd 版本:  2.3.1\r\n- 操作系统及其版本: mac 10.12.1 (16B2555)\r\n- 浏览器及其版本: 54.0.2840.87\r\n\r\n#### 您做了什么？请提供尽可能详细的重现步骤。\r\n\r\n使用Select 及 Option组件时，使用map返回的数组在DOMWrap里key不唯一，option只返回渲染了第一个\r\n\r\n代码：\r\n                      <Select>\r\n                        {\r\n                          list.map(function(elem, idx) {\r\n                            return (\r\n                              <Option key={idx} value={elem}>{elem}</Option>\r\n                            );\r\n                          })\r\n                        }\r\n                      </Select>\r\n\r\n报错：\r\nMention.js?9c0c:44 Warning: flattenChildren(...): Encountered two children with the same key, `.${elem}`. Child keys must be unique; when two children share a key, only the first child will be used.\r\n    in ul (created by DOMWrap)\r\n    in DOMWrap (created by Menu)\r\n    in Menu (created by DropdownMenu)\r\n    in div (created by DropdownMenu)\r\n    in DropdownMenu (created by SelectTrigger)\r\n    in LazyRenderBox (created by PopupInner)\r\n    in div (created by PopupInner)\r\n    in PopupInner (created by Popup)\r\n    in Align (created by Popup)\r\n    in AnimateChild (created by Animate)\r\n    in Animate (created by Popup)\r\n    in div (created by Popup)\r\n    in Popup\r\n\r\n<!-- 如：引入 antd 了 Button -->\r\n\r\n#### 您期待的结果是:\r\n\r\n<!-- 如：像官网一样正常显示 -->\r\n\r\n#### 实际上的结果是:\r\n\r\n<!-- 如：样式错位了，最好提供截图 -->\r\n\r\n#### 可重现的在线演示\r\n\r\n<!-- 请修改并 Fork http://codepen.io/benjycui/pen/KgPZrE?editors=001 -->\r\n"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/262780622","html_url":"https://github.com/ant-design/ant-design/issues/3766#issuecomment-262780622","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/3766","id":262780622,"user":{"login":"motorguo","id":16831715,"avatar_url":"https://avatars.githubusercontent.com/u/16831715?v=3","gravatar_id":"","url":"https://api.github.com/users/motorguo","html_url":"https://github.com/motorguo","followers_url":"https://api.github.com/users/motorguo/followers","following_url":"https://api.github.com/users/motorguo/following{/other_user}","gists_url":"https://api.github.com/users/motorguo/gists{/gist_id}","starred_url":"https://api.github.com/users/motorguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motorguo/subscriptions","organizations_url":"https://api.github.com/users/motorguo/orgs","repos_url":"https://api.github.com/users/motorguo/repos","events_url":"https://api.github.com/users/motorguo/events{/privacy}","received_events_url":"https://api.github.com/users/motorguo/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T13:51:28Z","updated_at":"2016-11-24T13:51:28Z","body":"有空我把两端的 demo 都整出来，虽然现在能用。\r\n但是 `.$xx`, `./0` 真的太不爽了。\r\n需要利用 `Menu item` 的 `key` 做些事的时候，`e.key` 取出来的 `.$.$0`"}}
{"actor":{"display_login":"motorguo"}}