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
Currently using React Hook Form v7.51.2, I seem to encounter an issue with my fields that are built with the Controller component not fully unregistering when reading with getValues(), even though native inputs seems to be able to unregister as expected. Here's a CodeSandbox for reference, hopefully it is clear enough.
Toggle the checkbox once and press the "Log" button. It will return all the form values correctly.
Toggle the checkbox once more and press the "Log" button again. The controllerTextField is still in the form values with a value of undefined, even though the nativeTextField is now gone.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently using React Hook Form v7.51.2, I seem to encounter an issue with my fields that are built with the Controller component not fully unregistering when reading with
getValues()
, even though native inputs seems to be able to unregister as expected. Here's a CodeSandbox for reference, hopefully it is clear enough.https://codesandbox.io/p/devbox/react-hook-form-mui-controller-input-test-xl6ktl
Reproduction steps:
controllerTextField
is still in the form values with a value of undefined, even though the nativeTextField is now gone.Any insights are greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions