引入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)=>(
编辑
okText="Yes"
cancelText="No"
删除
)}
];
<Popconfirm>
- 删除
+ <span>删除</span>
</Popconfirm>
Please read documentation & FAQ and search issues before open an issue, THX!
It will be better if you read smart questions(提问的智慧).
感觉可以做一层适配,如果 children
不是 ReactElement,就自动包上 span
标签。
在 antd 这一层做适配即可。
Similar issue with Dropdown
I think
Similar issue with Dropdown I think
Most helpful comment
感觉可以做一层适配,如果
children
不是 ReactElement,就自动包上span
标签。