ant-design / ant-design/pro-components
🐛[BUG] ProTable的columns列定义中,如果定义了formItemProps.rules,行编辑模式就会报错hook.js:608 Invalid prop `onKeyDown` supplied to `React.Fragment`
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🐛 bug 描述
**Next.js 15 + react19** + ant design 5.26.2
兼容包也都加上了:
"@ant-design/nextjs-registry": "^1.0.2",
"@ant-design/v5-patch-for-react-19": "^1.0.3",
ProTable的columns列定义中,如果定义了formItemProps.rules,编辑模式就会报错:

通过action?.startEditable?.(record.id);开启行编辑:


### 📷 复现步骤
用的文档中的例子:
https://procomponents.ant.design/components/table?current=1&pageSize=5&tab=api#packages-table-src-components-table-tab-api-demo-single
只要删除rules就不报错,有rules就报错。
```typescript
{
title: "标题",
dataIndex: "title",
copyable: true,
ellipsis: true,
tooltip: "标题过长会自动收缩",
formItemProps: {
rules: [
{
required: true,
message: "此项为必填项",
},
],
},
},
```
### 🏞 期望结果
不报错
### 💻 复现代码
### © 版本信息
- ProComponents 版本: [e.g. 4.0.0]
- umi 版本
- 浏览器环境
- 开发环境 [e.g. mac OS]
### 🚑 其他信息
Contributor guide
Research direction
Start with the linked ProTable single-row-edit API example and reproduce the issue using Next.js 15, React 19, and Ant Design 5.26.2. Compare row editing with and without formItemProps.rules, then trace the source of the React.Fragment onKeyDown warning. Done means required rules work in row editing without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100