{"action":"opened","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/4095","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/4095/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/4095/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/4095/events","html_url":"https://github.com/ant-design/ant-design/issues/4095","id":192785577,"number":4095,"title":"Tooltip（Popconfirm）组件子组件不能有多个或者单个TextElement","user":{"login":"leungwensen","id":1655789,"avatar_url":"https://avatars.githubusercontent.com/u/1655789?v=3","gravatar_id":"","url":"https://api.github.com/users/leungwensen","html_url":"https://github.com/leungwensen","followers_url":"https://api.github.com/users/leungwensen/followers","following_url":"https://api.github.com/users/leungwensen/following{/other_user}","gists_url":"https://api.github.com/users/leungwensen/gists{/gist_id}","starred_url":"https://api.github.com/users/leungwensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leungwensen/subscriptions","organizations_url":"https://api.github.com/users/leungwensen/orgs","repos_url":"https://api.github.com/users/leungwensen/repos","events_url":"https://api.github.com/users/leungwensen/events{/privacy}","received_events_url":"https://api.github.com/users/leungwensen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-01T08:47:00Z","updated_at":"2016-12-01T08:47:00Z","closed_at":null,"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.4.3\r\n- 操作系统及其版本: MacOS Sierra \r\n- 浏览器及其版本: Chrome 54.0.2840.98 (64-bit)\r\n\r\n#### 您做了什么？请提供尽可能详细的重现步骤。\r\n\r\n```jsx\r\n<Tooltip title=\"prompt text\">\r\n    <span>Text will show when mouse enter.</span>\r\n    extra text element\r\n  </Tooltip>\r\n```\r\n\r\n#### 您期待的结果是:\r\n\r\n正常显示tooltip\r\n\r\n#### 实际上的结果是:\r\n\r\n`index.tsx:128 Uncaught TypeError: Cannot read property 'className' of undefined`\r\n\r\n问题的根源在于，Tooltip的实现用到了childNode的属性（直接写了`children.props`），而当childNode不止一个，或者是一个裸的TextElement的时候children是个数组或者字符串，而这两种情况下`children.props`都是取不到的。\r\n\r\n问题代码： https://github.com/ant-design/ant-design/blob/master/components/tooltip/index.tsx#L122\r\n\r\n#### 可重现的在线演示\r\n\r\n多个子组件  http://codepen.io/leungwensen/pen/RoxwOM\r\n\r\n单个Text元素  http://codepen.io/leungwensen/pen/mOpdZK\r\n\r\nPopconfirm的情况类似。\r\n\r\n"}}
{"actor":{"display_login":"leungwensen"}}