Is there any API to get all the registered fields? #7618
Replies: 7 comments 8 replies
-
I don't think there's currently any straightforward API to get the registered fields without supplying |
Beta Was this translation helpful? Give feedback.
-
You can check if your input is registered or not with the help of |
Beta Was this translation helpful? Give feedback.
-
I'm also looking for a way to get the registered fields, but can't use the defaultValues. Reason: I want to provide my database object (with many more keys) to react hook form as default values, but want to filter the provided keys with only the registered inputs (otherwise all other keys get submitted, I only want the keys with correlate with the inputs). Any ideas how to solve this? |
Beta Was this translation helpful? Give feedback.
-
Hello, bringing this question back. Is there a way to get registered fields? I'm currently using unregistering of the fields but with value keeping, so in the end I have all the values even if they are unregistered at the moment. |
Beta Was this translation helpful? Give feedback.
-
I did not find any API either - so i just created my own
|
Beta Was this translation helpful? Give feedback.
-
We should really have a way to get register fields please. We could help with implementing if needed |
Beta Was this translation helpful? Give feedback.
-
Hello,
is there an api to get one ore more fields form the registered form? Because
watch
method returns alwaysundefined
when no defaultValue exists. (Like @hookform/devtools does)Example:
In Package
@hookform/devtools
usescontrol
to get all registered fields (_fields key), but in Documentation it says, don't do it...Maybe there is another solution for this problem???
Thanks in advance :)
Beta Was this translation helpful? Give feedback.
All reactions