mirror of
https://github.com/LukeHagar/form.git
synced 2025-12-09 04:19:49 +00:00
feat: add back form validation (#505)
* initial attempt to add back form validation * uncomment tests * fixed form validation not running * onChange + onBlur * feat: mount method on FormApi * fix solid-form test case * fix checkLatest * add onMount logic + test * fix: run mount on proper API * test: add React Form onChange validation tests --------- Co-authored-by: aadito123 <aaditolkar123@gmail.com> Co-authored-by: aadito123 <63646058+aadito123@users.noreply.github.com>
This commit is contained in:
@@ -40,13 +40,14 @@ export function useForm<TData, FormValidator>(
|
||||
|
||||
api.Provider = defineComponent(
|
||||
(_, context) => {
|
||||
onMounted(formApi.mount)
|
||||
onMounted(api.mount)
|
||||
provideFormContext({ formApi: formApi as never })
|
||||
return () => context.slots.default!()
|
||||
},
|
||||
{ name: 'Provider' },
|
||||
)
|
||||
api.provideFormContext = () => {
|
||||
onMounted(api.mount)
|
||||
provideFormContext({ formApi: formApi as never })
|
||||
}
|
||||
api.Field = Field as never
|
||||
|
||||
Reference in New Issue
Block a user