|
| 1 | +--- |
| 2 | +id: createFormHook |
| 3 | +title: createFormHook |
| 4 | +--- |
| 5 | + |
| 6 | +<!-- DO NOT EDIT: this page is autogenerated from the type comments --> |
| 7 | + |
| 8 | +# Function: createFormHook() |
| 9 | + |
| 10 | +```ts |
| 11 | +function createFormHook<TComponents, TFormComponents>(opts): object |
| 12 | +``` |
| 13 | + |
| 14 | +Defined in: [packages/solid-form/src/createFormHook.tsx:232](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createFormHook.tsx#L232) |
| 15 | + |
| 16 | +## Type Parameters |
| 17 | + |
| 18 | +• **TComponents** *extends* `Record`\<`string`, `Component`\<`any`\>\> |
| 19 | + |
| 20 | +• **TFormComponents** *extends* `Record`\<`string`, `Component`\<`any`\>\> |
| 21 | + |
| 22 | +## Parameters |
| 23 | + |
| 24 | +### opts |
| 25 | + |
| 26 | +`CreateFormHookProps`\<`TComponents`, `TFormComponents`\> |
| 27 | + |
| 28 | +## Returns |
| 29 | + |
| 30 | +`object` |
| 31 | + |
| 32 | +### useAppForm() |
| 33 | + |
| 34 | +```ts |
| 35 | +useAppForm: <TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>(props) => AppFieldExtendedSolidFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, TComponents, TFormComponents>; |
| 36 | +``` |
| 37 | + |
| 38 | +#### Type Parameters |
| 39 | + |
| 40 | +• **TFormData** |
| 41 | + |
| 42 | +• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> |
| 43 | + |
| 44 | +• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> |
| 45 | + |
| 46 | +• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> |
| 47 | + |
| 48 | +• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> |
| 49 | + |
| 50 | +• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> |
| 51 | + |
| 52 | +• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> |
| 53 | + |
| 54 | +• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> |
| 55 | + |
| 56 | +• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> |
| 57 | + |
| 58 | +• **TSubmitMeta** |
| 59 | + |
| 60 | +#### Parameters |
| 61 | + |
| 62 | +##### props |
| 63 | + |
| 64 | +`Accessor`\<`FormOptions`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>\> |
| 65 | + |
| 66 | +#### Returns |
| 67 | + |
| 68 | +`AppFieldExtendedSolidFormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`, `TComponents`, `TFormComponents`\> |
| 69 | + |
| 70 | +### withForm() |
| 71 | + |
| 72 | +```ts |
| 73 | +withForm: <TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, TRenderProps>(__namedParameters) => (props) => Element; |
| 74 | +``` |
| 75 | + |
| 76 | +#### Type Parameters |
| 77 | + |
| 78 | +• **TFormData** |
| 79 | + |
| 80 | +• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> |
| 81 | + |
| 82 | +• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> |
| 83 | + |
| 84 | +• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> |
| 85 | + |
| 86 | +• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> |
| 87 | + |
| 88 | +• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> |
| 89 | + |
| 90 | +• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> |
| 91 | + |
| 92 | +• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> |
| 93 | + |
| 94 | +• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> |
| 95 | + |
| 96 | +• **TSubmitMeta** |
| 97 | + |
| 98 | +• **TRenderProps** *extends* `Record`\<`string`, `unknown`\> = \{\} |
| 99 | + |
| 100 | +#### Parameters |
| 101 | + |
| 102 | +##### \_\_namedParameters |
| 103 | + |
| 104 | +[`WithFormProps`](../../interfaces/withformprops.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`, `TComponents`, `TFormComponents`, `TRenderProps`\> |
| 105 | + |
| 106 | +#### Returns |
| 107 | + |
| 108 | +`Function` |
| 109 | + |
| 110 | +##### Parameters |
| 111 | + |
| 112 | +###### props |
| 113 | + |
| 114 | +`ParentProps`\<`NoInfer`\<`UnwrapOrAny`\<`TRenderProps`\>\> & `object`\> |
| 115 | + |
| 116 | +##### Returns |
| 117 | + |
| 118 | +`Element` |
0 commit comments