Describe the bug
After upgrading the v7 rc.4, it seems there is now an issue with typescript. When I provide a form values type as a generic to
useForm and call
setValue with a field array, typescript will show a compile-time error of:
Type instantiation is excessively deep and possibly infinite.
This worked fine in the previous versions. Additionally, my form values type is not recursive or infinitely deep.
Steps to reproduce the behavior:
- Go to the sandbox
- Notice the typescript error
Codesandbox link (Required)
This should not throw an error.
I added full types as they appear in my project to replicate the bug as best as possible. I think the error is focused on the
FieldsToMatch section of the
Queries field array.