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

引入Popconfirm 报 'className' of undefined错误 #3924

Closed
zwz111 opened this issue Nov 19, 2016 · 7 comments
Closed

引入Popconfirm 报 'className' of undefined错误 #3924

zwz111 opened this issue Nov 19, 2016 · 7 comments
Labels
help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.

Comments

@zwz111
Copy link

zwz111 commented Nov 19, 2016

发生问题的环境是:

  • antd 版本:2.4.3
  • 操作系统及其版本:win
  • 浏览器及其版本: Google Chrome版本 54.0.2840.99 m

您做了什么?请提供尽可能详细的重现步骤。

引入antd 的 Popconfirm

报错 Uncaught TypeError: Cannot read property 'className' of undefined

如果不用这个组件 代码正常

代码如下

const columns = [
{title: '昵称', dataIndex: 'nickName', key: 'nickName'},
{title: '登录名', dataIndex: 'loginName', key: 'loginName'},
{title: '姓名', dataIndex: 'name', key: 'name', render: (text)=>{text}},
{title: '操作', dataIndex: '', key: 'operation', render: (text)=>(


编辑
<Popconfirm title="确定要删除吗"
onConfirm={()=>Message.success("点击了确认删除")}
okText="Yes"
cancelText="No"
>删除


)}
];

@yesmeck
Copy link
Member

yesmeck commented Nov 19, 2016

能帮我们重现一下吗 http://codepen.io/benjycui/pen/KgPZrE?editors=001

@afc163
Copy link
Member

afc163 commented Nov 20, 2016

<Popconfirm>
-  删除
+  <span>删除</span>
</Popconfirm>

@afc163
Copy link
Member

afc163 commented Nov 20, 2016

Please read documentation & FAQ and search issues before open an issue, THX!

It will be better if you read smart questions(提问的智慧).

@afc163 afc163 closed this as completed Nov 20, 2016
@benjycui
Copy link
Contributor

benjycui commented Nov 21, 2016

感觉可以做一层适配,如果 children 不是 ReactElement,就自动包上 span 标签。

@benjycui benjycui reopened this Nov 21, 2016
@benjycui benjycui added the help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. label Nov 21, 2016
@benjycui
Copy link
Contributor

在 antd 这一层做适配即可。

@davidfurlong
Copy link

Similar issue with Dropdown I think

@Carrie999
Copy link

Similar issue with Dropdown I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.
Projects
None yet
Development

No branches or pull requests

6 participants