ant-design / ant-design/pro-components

🐛[BUG]ProForm.useWatch无效

Open
#8,921 0 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

### 🐛 bug 描述

无法监听,字段改变不会重新渲染

### 📷 复现步骤

使用ProForm.useWatch监听一个字段变化

### 💻 复现代码

` const region = ProForm.useWatch('region', { form: formRef?.current });

useEffect(() => {
console.log(region);
}, [region]);`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the provided ProForm.useWatch snippet and inspect the ProForm.useWatch implementation and its form subscription behavior. Done means changing the watched field causes the component to re-render and the effect to log the updated value.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.