Auto submission after successful validation #1724
Answered
by
yuzhakovvv
yuzhakovvv
asked this question in
Q&A
-
I want to do auto submission after successful validation. I didn't find a way to provide a callback to run after validation though What's the best way to do this? So far I've come up with this: const form = useAppForm(...);
const canSubmit = useStore(form.store, (state) => state.canSubmit);
useEffect(() => {
if (canSubmit) {
form.handleSubmit();
}
}, [canSubmit, form]); |
Beta Was this translation helpful? Give feedback.
Answered by
yuzhakovvv
Sep 10, 2025
Replies: 1 comment 4 replies
-
What validators are you using? What is the submission going to do? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've ended up creating
AutoSubmit
component that subscribes to form's state. This way only this component rerenders.This component can be dropped …