-
Notifications
You must be signed in to change notification settings - Fork 849
feat(form): Introduce useForm
and useFormControl
composable
#4755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3
Are you sure you want to change the base?
Conversation
commit: |
This PR still mising some task, If there are any additions, they can be added here.:
Maybe i need help to verify my typescript, cc @sandros94 |
// @ts-expect-error - 'target' does not exist in type 'EventInit' | ||
const event = new Event('change', { target: { value } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we cannot modify target
because is read-only
https://developer.mozilla.org/en-US/docs/Web/API/Event/target
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romhml haven't we discussed this before? It does ring a bell in my head π€
Will happily take a look in a couple of days, as I'm on vacation and with limited connectivity |
useForm
composableuseForm
and useFormControl
composable
Iβve finished handling state generation based on schema. here how i implement it: Valibot: users can use the built-in getDefaults() Yup: supports .getDefault() on schema, so I handle this internally. Superstruct: no built-in way for defaults, so users will need to provide their own defaultValues. |
thanks @rdjanuar, I've been following some of the commits, but unfortunately I got buried with work since I came back from vacation. Will hopefully take a look at least at types during the weekend. Just a small note: while I completely agree on a |
Thank you @sandros94 for taking the time to review my useForm implementation. you right its' require a lot effort to handle parsing on each library schema but my current implementation is just improve DX especially on zod because every time i interact with Form component i should add every single field on |
π Linked issue
Resolves #3876
β Type of change
π Description
π Checklist