You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hi everyone, I'm implementing a feature using field array with some controlled custom input (using render attribute on Controller)
Then I ran into this issue, the watchedFieldArray's newly-added item gets undefined. I noticed that this issue happens when inserting an item at an in-between index.
To Reproduce
Steps to reproduce the behavior:
Go to CodeSandbox link
Click Insert at index 1
Watch the Console logs and see the index-1 item is undefined
Click Append
Watch the Console logs and see the last item is not undefined
bluebill1049
changed the title
useWatch on a field array of controlled components leads to unexpected behaviour
useWatch on a field array of controlled components leads to unexpected behaviour [Controller]
Nov 4, 2020
Describe the bug
Hi everyone, I'm implementing a feature using field array with some controlled custom input (using
render
attribute onController
)Then I ran into this issue, the
watchedFieldArray
's newly-added item getsundefined
. I noticed that this issue happens when inserting an item at an in-between index.To Reproduce
Steps to reproduce the behavior:
undefined
undefined
Desired output
Codesandbox link (Required)
https://codesandbox.io/embed/unruffled-thompson-yx492?file=/src/App.js:1628-2152
Expected behavior
the index-1 item is not
undefined
Desktop (please complete the following information):
Additional context
If I add
shouldUnregister: false
option touseForm
, the problem goes awayThe text was updated successfully, but these errors were encountered: