You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! First of all, thanks for your work! I've just started using your library and it seems very promising 馃槂!
I'd like to ask if it can be useful to export the FieldProps type from the Field component. The request comes from the fact that I'm creating my own custom input component. But instead of doing exactly what you have suggested on your doc, I'm also wrapping the Field component. Basically what I'd like to achive (and I'm able to do) is creating an Input component such as this one:
As you can see the code on App.tsx is very clean since I moved all the Field management on the Input component itself. The only problem was that to preserve type safety and Typescript autocompletion, I needed the FieldProps type. To fix this I just updated the Field.d.ts file to export it, but I wonder if this export can be included on your project. Unless, of course, there is already something better to achieve the same results that I'm not aware of.
Let me know if you need more info and if this request make sense at all! And of course, if needed, I can make a pull request, but maybe it's unnecessary since it's just a single line of code 馃槂!
Thanks!
The text was updated successfully, but these errors were encountered:
I think this would be a good addition. I recently found myself trying to import the FormProps type, which should also be exported I think. My workaround without modifying files was using:
but I think it would be much easier if the type would be exported.
@Corsal8 small hint: When using modular-forms with zod, it is better to use z.input<typeof UserSchema> instead of z.infer<typeof UserSchema>, as z.infer gives you the output type of the schema, while you need the input type (this is more important if using zods transform method)
Nice! Thanks a lot for the feedback! Also, thanks a lot @apollo79 for the suggestion! I was't aware of the z.input method, but I'll start using it for sure :)!
Hi! First of all, thanks for your work! I've just started using your library and it seems very promising 馃槂!
I'd like to ask if it can be useful to export the FieldProps type from the Field component. The request comes from the fact that I'm creating my own custom input component. But instead of doing exactly what you have suggested on your doc, I'm also wrapping the Field component. Basically what I'd like to achive (and I'm able to do) is creating an Input component such as this one:
In this way, from other components, I can just do the following:
As you can see the code on App.tsx is very clean since I moved all the Field management on the Input component itself. The only problem was that to preserve type safety and Typescript autocompletion, I needed the FieldProps type. To fix this I just updated the Field.d.ts file to export it, but I wonder if this export can be included on your project. Unless, of course, there is already something better to achieve the same results that I'm not aware of.
Let me know if you need more info and if this request make sense at all! And of course, if needed, I can make a pull request, but maybe it's unnecessary since it's just a single line of code 馃槂!
Thanks!
The text was updated successfully, but these errors were encountered: