Can you use useField
outside a form?
#374
-
The documentation states the following:
However, when using
Is the documentation just incorrect or is there a way to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This line sounds outdated, it's wrong or misleading. It might be referring to the [use outside forms feature] (https://www.remix-validated-form.io/use-outside-forms), but that still requires there to be a form somewhere. I think the approach of having an RVF specific component that wraps the non-validated one is the right approach. FWIW, v6 doesn't require these wrapper components to function properly (but you can still make them if you want). They can be wired up directly in your form similarly to react-hook-form's register function. |
Beta Was this translation helpful? Give feedback.
This line sounds outdated, it's wrong or misleading. It might be referring to the [use outside forms feature] (https://www.remix-validated-form.io/use-outside-forms), but that still requires there to be a form somewhere.
I think the approach of having an RVF specific component that wraps the non-validated one is the right approach.
FWIW, v6 doesn't require these wrapper components to function properly (but you can still make them if you want). They can be wired up directly in your form similarly to react-hook-form's register function.