Replies: 2 comments 8 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? |
Beta Was this translation helpful? Give feedback.
-
Hey guys sorry to bump an old thread, but we use the |
Beta Was this translation helpful? Give feedback.
-
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?Beta Was this translation helpful? Give feedback.
All reactions