useSubmissionError
useSubmissionError accepts a form and returns the
Error that was thrown when the
form was last submitted, or undefined.
If a non-Error was thrown, then the value which was thrown will be wrapped in an Error and Error#cause will be set.
Sample usage
Section titled “Sample usage”const form = useForm({ initialValues: { username: "" }});const submissionError = useSubmissionError(form);//^? Error | undefinedif (submissionError) { return <div>There was an error</div>}function useSubmissionError(form: Form<any>): Error | undefined