ant-design / ant-design/pro-components

🐛[BUG] ProForm params 的內容如果變更為之前的值會導致 ProForm 不會正常更新內容

Open
#9,133 2 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 描述

ProForm params 的內容如果變更為之前的值會導致 ProForm 不會正常更新內容
目前可以在 ProForm 上帶入 key 值來避免此問題發生(強制重新渲染
但這樣有點喪失 params 的功能特性

### 📷 复现步骤

設置 params 的值循環 ex. { id: 0 ~2 }
當params 的值循環至之前已請求過的參數時
無法正確請求更新內容

### 🏞 期望结果

params 值如果改變應正常觸發請求,並變更對應欄位值

### 💻 复现代码

https://codesandbox.io/p/devbox/chong-zhi-biao-dan-forked-66wpf8?workspaceId=ws_YJZCMmh6qYjSpQw6S4Lj8a

### © 版本信息

- ProComponents 版本: 2.8.7
- antd 5.26.0

### 🚑 其他信息

![Image](https://github.com/user-attachments/assets/a03134f6-bbb3-4d9f-aabf-f10645758dc6)

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and the ProForm params update path. Reproduce a params sequence such as IDs 0 through 2, including a previously used value, then trace why the request is not triggered. Done means changing params to any value, including a previously requested one, refreshes the request and corresponding field values without requiring a changing key.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.