devtool prevent field in values prop from registering

未关闭
#197 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react, typescript
领域
devtools, frontend

调研方向

Start with the reproduction in /src/App.tsx and compare useForm({ defaultValues: { str } }) with the useForm({ values: { str } }) update while DevTools is enabled. Verify the reported behavior in the CodeSandbox; done means the field registers and its displayed value updates in the values case as it does with defaultValues.

由索引模型根据 Issue 内容生成。

描述

Version Number

react-hook-form: 7.43.9
react: 18.2.0

Codesandbox/Expo snack

https://codesandbox.io/s/hookform-devtools-bug-devtool-prevent-field-in-values-prop-from-registering-minvzb?file=/src/App.tsx

Steps to reproduce

I have two video clip to demonstrate. Both two demo had devtool on.

By useForm({ defaultValues: { str } }). It works as expect.

https://user-images.githubusercontent.com/38932402/229013340-0d389873-ae62-4922-91fd-e97e5d417d12.mp4

By useForm({ values: { str } }). I use a useEffect to trigger the update behavior of values. The field seems not to be registered as the "value" show above the input is never updated.

https://user-images.githubusercontent.com/38932402/229014523-8c7695e4-65b5-4b66-8774-c5dbb812f1ef.mp4

主要语言
TypeScript
星标
670
派生
55
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

react-hook-form/devtools 的其他 Issue

查看 react-hook-form/devtools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。