Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

FormGroupSubmitContext.md

107 lines2.1 KB

1---
2id: FormGroupSubmitContext
3title: FormGroupSubmitContext
4---
5​
6Defined in: [FormGroupApi/FormGroupApi.public.ts:26](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L26)
7​
8Context passed to a form group's `onSubmit` after group validation succeeds.
9​
10## Example
11​
12```ts
14 // ...
15 onSubmit: async ({ value }) => {
16 await saveGuestDetails(value)
17 },
19```
20​
21## Type Parameters
22​
23### TFormData
24​
25`TFormData`
26​
27### TGroupName
28​
29`TGroupName`
30​
31### TGroupValue
32​
33`TGroupValue`
34​
35### TOutputs
36​
37`TOutputs`
38​
39### TGroupErrorTypes
40​
41`TGroupErrorTypes` *extends* [`FormErrorTypes`](FormErrorTypes.md)
42​
43### TFormErrorTypes
44​
45`TFormErrorTypes` *extends* [`FormErrorTypes`](FormErrorTypes.md)
46​
47## Properties
48​
49### formApi
50​
51```ts
52formApi: FormApi<TFormData, TFormErrorTypes>;
53```
54​
55Defined in: [FormGroupApi/FormGroupApi.public.ts:37](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L37)
56​
57The parent form API handling this submission.
58​
59***
60​
61### groupApi
62​
63```ts
64groupApi: FormGroupApi<TFormData, TGroupName, TGroupValue, TGroupErrorTypes, TFormErrorTypes>;
65```
66​
67Defined in: [FormGroupApi/FormGroupApi.public.ts:39](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L39)
68​
69The group API handling this submission.
70​
71***
72​
73### validatorOutputs
74​
75```ts
76validatorOutputs: TOutputs;
77```
78​
79Defined in: [FormGroupApi/FormGroupApi.public.ts:62](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L62)
80​
81Schema outputs and `createOutput` payloads from this group submission,
82ordered by validator index. Skipped validators and successful returns
83without an output contribute `undefined`.
84​
85#### Example
86​
87```ts
89 // ...
90 onSubmit: async ({ validatorOutputs }) => {
91 const validatedGuestDetails = validatorOutputs[0]
92 setStep(step => step + 1)
93 },
95```
96​
97***
98​
99### value
100​
101```ts
102value: TGroupValue;
103```
104​
105Defined in: [FormGroupApi/FormGroupApi.public.ts:35](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L35)
106​
107The group values for this submission.