ant-design / ant-design/pro-components

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

Open
#8,830 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

提问前先看看:

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 (
{
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](https://github.com/user-attachments/assets/feb2a0a4-3848-48ec-b059-65ddc0ee6fbd)

Contributor guide

Open the contributing guide

Research direction

Start from the ProTable entry point and reproduce the warning with the supplied columns, request, and React 18 versions. Compare the behavior with search and options enabled versus disabled, then verify that the console warning is gone without changing the reported table behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.