Skip to content
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

issue: watched field doesn't get updated in a specific scenario where useFormState is used #11229

Closed
1 task done
wenchonglee opened this issue Nov 25, 2023 · 0 comments
Closed
1 task done

Comments

@wenchonglee
Copy link

Version Number

7.48.2

Codesandbox/Expo snack

https://stackblitz.com/edit/vitejs-vite-r4kauk?file=src%2FApp.tsx

Steps to reproduce

  1. Go to the stackblitz demo
  2. The first component is the one with an issue, where the watch value remains undefined
  3. All 3 components rendered follow the same scenario:
    • Every component has a useQuery hook that fetches data on a delay (this shouldn't matter)
    • Every component uses watch on the text field test
    • A very specific scenario where useFormState destructures both isSubmitSuccessful and isSubmitting will not update the watch state

Expected behaviour

The watched value should be updated in all cases.

  • Another observation is that this only happens if I'm using useController, using a regular <input {...methods.register("test")} /> wouldn't have this issue
  • Unless intended, this is a regression from 4.47.0, you can change the version and try it for yourself

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 24, 2024
rafaelcalhau pushed a commit to rafaelcalhau/react-hook-form that referenced this issue May 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant