Prepend is causing an extra render when used with Controller

Describe the bug
Prepend is causing an extra render when used with Controller.

To Reproduce
Using the example here: https://codesandbox.io/s/react-hook-form-usefieldarray-vy8fv click prepend and the render count will jump to 3. If you change the Controller to another standard input like the firstname it does however correctly re-render once.

Codesandbox link
https://codesandbox.io/s/react-hook-form-usefieldarray-vy8fv

Expected behavior
Only one extra render to occur

Screenshots
image

Desktop:

  • OS: Windows 10
  • Browser Chrome
  • Version 88.0.4324.182

1 possible answer(s) on “Prepend is causing an extra render when used with Controller

  1. Ok, I think I am going to skip this PR, the updateFormState actually serves two formstate

    • build-in validation isValid
    • update form state dirty

    I think for that extra single re-render we will live with it in v6, this should be fixed in v7. Thanks for your detailed investigation @leapful