Why build your own form library? #5263
Replies: 3 comments 2 replies
-
I build the library to:
Building a library from scratch is fun. Maintaining a third-party integration is not really fun. |
Beta Was this translation helpful? Give feedback.
-
One of the biggest downsides to implementing a custom form library is that it doesn't play ball with native forms. Doing I would suggest not using the custom form hooks until something is done to maintain compatibility with native HTML forms. |
Beta Was this translation helpful? Give feedback.
-
In Argentina a few group of people use mantine to stylize projects... I'm glad to be into that group... MANTINE ❤ |
Beta Was this translation helpful? Give feedback.
-
I've used Mantine form pretty extensively on a large project of mine and have ran into a gazillion issues with it -- the entire form re-rendering on every input change, current form submission/validation state not being exposed, typescript types for field names (from the validation schema) are not enforced on
setFieldValue
andgetInputProps
function parameters, zod validation transformations don't occur prior to submit, useForm'stransform
doesn't allow changing the value's data type without typescript getting mad, the list goes on and on.I've used React Hook Form on other larger projects and have never had any of these same issues, in fact everything just works.
It seems like a lot of extra work to engineer and maintain a form library when there is already an alternative that does everything your current library does and much, much more. It has nearly the exact same base API, is significantly more performant, and is backed by an independent very large developer community.
Admittedly, yes, there are now ways to use React Hook Form with Mantine V7 using one of their 3rd-party bindings: https://github.com/aranlucas/react-hook-form-mantine
My suggestion is to ditch Mantine form and use React Hook Form instead.
Then, add these 3rd-party bindings into the Mantine form project.
This would allow users to utilize a significantly more powerful form library while seamlessly using Mantine components.
I'd genuinely like to know the reason why you built your own form library rather than using React Hook Form.
Beta Was this translation helpful? Give feedback.
All reactions