Replies: 2 comments 9 replies
|
At the moment we don't have anything to handle invalid submissions. You work around that by manually calling But it might be a good thing to have to make it easier, I don't have a strong opinion about how we should go about it. I'm thinking we could introduce a second callback to const onSubmit = handleSubmit(() => {
// submit values
}, (errors) => {
const firstError = Object.keys(errors)[0];
document.querySelector(`input[name="${firstField}"]`);
});What do you think? |
7 replies
|
Hey guys sorry to bump an old thread, but we use the |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, loving v4 so far. Combined with yup, the DX is so much better.
However, I have a question, as title, can I get a callback (like
handleSubmit) where I can perform some side effects after a validation occur?All reactions