-
-
Notifications
You must be signed in to change notification settings - Fork 278
fix useWatch not updating #756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次变更新增了一个关于 useWatch 的嵌套列表级别用法的文档和示例,调整了 useForm 和 interface 中 Watch 回调的参数签名,简化了通知逻辑,并对 useWatch 的实现细节进行了小幅优化。 Changes
Sequence Diagram(s)sequenceDiagram
participant User as 用户
participant Demo as Demo 组件
participant Form as Form
participant Child as Child 组件
participant useWatch as useWatch Hook
User->>Demo: 添加/删除列表项
Demo->>Form: 渲染 Form.List
Form->>Child: 渲染每个列表项
Child->>useWatch: 订阅 name 字段变化
useWatch->>Form: 注册 Watch 回调
User->>Form: 修改 name 字段
Form->>useWatch: 通知回调(仅传递 values, allValues)
useWatch->>Child: 更新当前 name 值显示
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
docs/examples/useWatch-list-level2.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. src/useForm.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. src/useWatch.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🧰 Additional context used🧬 Code Graph Analysis (1)docs/examples/useWatch-list-level2.tsx (1)
🔇 Additional comments (12)
✨ Finishing Touches
🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #756 +/- ##
=======================================
Coverage 99.44% 99.44%
=======================================
Files 18 18
Lines 1260 1260
Branches 298 316 +18
=======================================
Hits 1253 1253
Misses 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit