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: watch not working as expected for nested components using useFormContext #11813

Open
1 task done
ksmith173 opened this issue Apr 23, 2024 · 0 comments
Open
1 task done
Labels
status: under investigation aware of this issue and pending for investigation

Comments

@ksmith173
Copy link

Version Number

7.51.3

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/watch-test-kwvsn9

Steps to reproduce

  1. Load code sandbox
  2. Note how "One is selected" is not visible under the drop down on page load.
  3. Change package.json version of react-hook-forms to 7.50.1 (or access this cloned with the version pre-set https://codesandbox.io/p/sandbox/watch-test-forked-rg2shh)
  4. Note how "One is selected" IS visible under the drop down on page load

Expected behaviour

In version 7.50.1 and prior, the watch on a Controller wrapped input with its value set by setValue would trigger the form to re-render and show conditional items. After this version, this no longer happens.

The issue seems to be limited to nested components that are using useFormContext.

What browsers are you seeing the problem on?

Firefox, Chrome

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 added the status: under investigation aware of this issue and pending for investigation label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: under investigation aware of this issue and pending for investigation
Projects
None yet
Development

No branches or pull requests

2 participants