Skip to content

Can you use useField outside a form? #374

Answered by airjp73
mattbeiswenger asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mattbeiswenger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants