formState.isValid behaviour changed between version 6.11.3 and 6.11.4 when using resolver.

Describe the bug
In version 6.11.3 and before, the formState.isValid was true when the forms defaultValues are valid but not rendered in the DOM.
In version 6.11.4 and after, the formState.isValid is initially set to true, but is immediately set to false after the resolver has run, even if the defaultValues are valid.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/rhf-incorrect-isvalid-wluyk?file=/src/App.tsx
  2. Open console and see that: isValid is initially true, but later set to false after resolver has been run.
  3. Click “Toggle form” and see that the Confirm button is disabled (and the isValid flag continues to be false)

Codesandbox link (Required)
https://codesandbox.io/s/rhf-incorrect-isvalid-wluyk?file=/src/App.tsx

Expected behavior
I expect the isValid flag to be true when clicking “Toggle form” to display the form.
Expected behavior can be reproduced by opening the above codesandbox (https://codesandbox.io/s/rhf-incorrect-isvalid-wluyk?file=/src/App.tsx) and changing the react-hook-form version to 6.11.3

Desktop (please complete the following information):

  • OS: MacOS 10.15.7
  • Browser Chrome 88.0.4324.146
  • Version 6.11.4 and later

1 possible answer(s) on “formState.isValid behaviour changed between version 6.11.3 and 6.11.4 when using resolver.