Skip to content

Commit 9ce5f28

Browse files
fix(react-form): ensure FormApi.handleSubmit returns a promise again (#1924)
* fix(react-form): fix handleSubmit no longer returning a promise * Fix FormApi.handleSubmit to return a promise * ci: apply automated fixes and generate docs --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 6a5e1c1 commit 9ce5f28

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/serious-lamps-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/react-form': patch
3+
---
4+
5+
fix(react-form): ensure `FormApi.handleSubmit` returns a promise again

packages/react-form/src/useForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export function useForm<
228228
> = {
229229
...formApi,
230230
handleSubmit: ((...props: never[]) => {
231-
formApi._handleSubmit(...props)
231+
return formApi._handleSubmit(...props)
232232
}) as typeof formApi.handleSubmit,
233233
// We must add all `get`ters from `core`'s `FormApi` here, as otherwise the spread operator won't catch those
234234
get formId(): string {

0 commit comments

Comments
 (0)