Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/content/docs/useform/handlesubmit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ This function will receive the form data if form validation is successful.
// await fetch()
} catch (e) {
// handle your error
setError("service", {
type: "custom",
message: "something went wrong",
})
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/data/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,10 @@ handleSubmit(async (data) => await fetchAPI(data))`}
// await fetch()
} catch (e) {
// handle your error
setError("service", {
type: "custom",
message: "something went wrong",
})
}
};

Expand Down