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

🐛[BUG]【ProTable】findDOMNode is deprecated and will be removed in the next major release. #8830

Open
Aslan-Monster opened this issue Oct 26, 2024 · 2 comments

Comments

@Aslan-Monster
Copy link

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

正常情况下会出现“findDOMNode is deprecated and will be removed in the next major release.”警告,设置search和options为false后控制台报错消失

🏞 期望结果

有什么解决办法可以去除此警告

💻 复现代码

import React from "react";
import type { ActionType, ProColumns } from "@ant-design/pro-components";
import { ProTable } from "@ant-design/pro-components";
import { useRef } from "react";

const Demo = () => {
const actionRef = useRef();
const columns: ProColumns[] = [
{
dataIndex: "index",
valueType: "indexBorder",
width: 48,
},
{
title: "角色编码",
key: "code",
dataIndex: "code",
},
{
title: "角色名称",
key: "name",
dataIndex: "name",
},
{
title: "角色描述",
key: "description",
dataIndex: "description",
},
];
return (
<ProTable
columns={columns}
actionRef={actionRef}
cardBordered
request={async () => {
return {
data: [
{
id: 1,
code: 1,
name: "test",
description: "测试",
},
],
success: true,
};
}}
//search={false}
//options={false}
rowKey="id"
pagination={{
pageSize: 5,
onChange: (page) => console.log(page),
}}
dateFormatter="string"
/>
);
};

export default Demo;

© 版本信息

"@ant-design/pro-components": "^2.8.1",
"antd": "^5.21.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",

🚑 其他信息

微信图片_20241026173348

Copy link

以下的 Issues 可能会帮助到你 / The following issues may help you

@resetsix
Copy link

see #8837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants