HTML controls #2993
-
I'm struggling with Blitz at the moment because I'm not sure how to work with all the html controls I need to build an application. Can you guys recommend an easier approach for me such that I can create all the html controls I like and get the Zod validation working too? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
So MUI is a component library that gives you a set of components to use, and there are libraries like react-final-form, react-hook-form, or formik (you can choose when setting up a Blitz project) that provide form state management, and tools to work with forms. You can set initial values, validate easily (zod validation is passed in You might be interested in this library: https://github.com/lookfirst/mui-rff — it provides mui bindings for react-final-form. |
Beta Was this translation helpful? Give feedback.
So MUI is a component library that gives you a set of components to use, and there are libraries like react-final-form, react-hook-form, or formik (you can choose when setting up a Blitz project) that provide form state management, and tools to work with forms. You can set initial values, validate easily (zod validation is passed in
validate
prop), and do much more with these libraries. However, it's not mandatory to use them. The tradeoff is that you'd need to handle it all by yourself (state, validation, etc). That's why the most common way is to wrap you custom inputs inreact-final-form
(or there lib) utilities, so you can take full advantage of it.You might be interested in this lib…