ant-design / ant-design/pro-components

ProTable作为form使用时rowKey无法使用🐛[BUG]

Open
#7,166 2 comments 0 reactions 0 assignees View on GitHub
🤷🏼 How to use
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

#### 在使用ProTable组件时,`type="form"`,作为表单使用,添加了`rowKey={() => nanoid()}`
![image](https://github.com/ant-design/pro-components/assets/28668830/5dc5984c-c9d3-46a3-8737-c78bc940aaa4)

#### 但表单渲染出来后依然没有key
![image](https://github.com/ant-design/pro-components/assets/28668830/e8890b6f-d025-4f24-bee2-83560babad4c)

## 如果在columns中添加key也可以解决,但也会存在新的问题,就是表单的name属性变成了key.
![image](https://github.com/ant-design/pro-components/assets/28668830/f82d1250-2383-41e1-9548-72598b784039)

我的ProComponents版本:─ @ant-design/pro-components@2.4.4

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the ProTable issue with type="form" and rowKey={() => nanoid()} using @ant-design/pro-components@2.4.4, then trace the ProTable form rendering path. Verify how rowKey and column keys are handled, especially the reported effect on the form name attribute. Done means the rendered form has stable keys without changing field names.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.