V7 Typescript issue – RC 7.0.0-rc.7 – useFieldArray append issue

Describe the bug
After upgrading to 7.0.0-rc.7, I’m noticing a typescript error with useFieldArray's append method when using a generic type for our form values. My form values are valid and have not changed between versions. The error is:

Argument of type '{ name: string; }' is not assignable to parameter of type 'never[]'.
  Object literal may only specify known properties, and 'name' does not exist in type 'never[]'

It seems related to having nested objects present in the form values type along with a field array. If you remove some of the other objects, the error should go away.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the sandbox
  2. View the error the append method

Codesandbox link (Required)

Expected behavior
There should be no error as my form values are a valid type

Screenshot from 2021-03-23 17-16-16

2 thoughts on “V7 Typescript issue – RC 7.0.0-rc.7 – useFieldArray append issue