Closed bastibuck closed 1 year ago
thanks for repro.
you'll need to pass the zod resolver in manually to get this to work as expected:
import {zodResolver} from '@hookform/resolvers/zod';
// ...
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema)
});
I'll update the documentation on this to make it more obvious.
Nice thank you - it did the trick. Good idea to update the docs about this. Pretty sure it's a common usecase. Thanks for maintaining this lib :)
Version Number
1.8.0
Codesandbox/Expo snack
https://codesandbox.io/s/misty-water-r232jh?file=/src/App.tsx
Steps to reproduce
When you don't pass the
form
coming fromuseForm()
to<Form />
via props the first button validates and doesn't log correctly.Expected behaviour
I'd like to trigger the submit from a parent/sibling component using the
useForm()
hook. Found this https://react-ts-form.com/docs/docs/usage/form-state and tried it.reset()
seems to work fine but submitting doesn't.Is there a way to trigger the form not from within the
renderAfter
orrenderBefore
?Relevant log output
No response