React hook form + DevTool + reset causes from to not register fields correctly

Open
#173 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Open the linked StackBlitz and inspect package.json and App.jsx. Reproduce the async reset with react-hook-form 7.34.2, then compare the behavior when DevTool is removed and when the version is downgraded to 7.15. Done means identifying whether DevTool or react-hook-form causes the fields and values to display correctly after reset.

Written by the indexing model from the issue text.

Description

Version Number

7.34.2

Codesandbox/Expo snack

https://stackblitz.com/edit/react-hook-form-set-form-values-in-useeffect-m65nbe?file=package.json,App.jsx

Steps to reproduce
  1. Go to the sandbox
  2. Form doesn't get filled in with initial values

It works if devtools is removed from the component. It also works if form version is downgraded to 7.15.

It used to work fine on version 7.15. I didn't try other versions to find out which one broke it. I'm also not sure if it's a bug on @hookform/devtools or on react-hook-form.

Expected behaviour

Form gets reset to async values and fields register correctly. Dev tools display fields with values.

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
TypeScript
Stars
670
Forks
55
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-hook-form/devtools

All issues in react-hook-form/devtools

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.