Is Form compatitble with react-hook-form, yup, zod, etc.? Or is that redundant? #3110
Unanswered
ianpaschal
asked this question in
Help
Replies: 1 comment 2 replies
-
@ianpaschal |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After somewhat crudely attempting to wire together a
react-hook-form
form (using Zod) for validation this weekend, I was frustrated that there doesn't seem to be much guidance on how to use the RadixForm
with RHF.And then it hit me... it's not supposed to be, right? I have to admit I've never looked into the Constraint validation functionality of HTML5, relying for years on Formik and
yup
and more recentlyreach-hook-form
andzod
. But it seems that the everything that such libraries were used for is covered by the combination of theForm
component and some custom validation functions.I guess my question is: Am I right in assuming that trying to use RHF and
Form
is actually a bit of an anti-pattern? It suddenly hit me that I was essentially using two form management solutions at once and (expectably) struggling to get them to play nice.The follow up would be: If this is indeed correct, maybe it's nice to add something to the documentation that it's intended to be a replacement. And if I'm not, what is the usecase for using both validation methods on top of each other? Any chance someone smarter than me has a working example showing the benefits of using them in conjunction?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions