createFormHook

Function: createFormHook()

ts
function createFormHook<TComponents, TFormComponents>(__namedParameters): object;
function createFormHook<TComponents, TFormComponents>(__namedParameters): object;

Defined in: packages/react-form/src/createFormHook.tsx:293

Type Parameters

TComponents

TComponents extends Record<string, ComponentType<any>>

TFormComponents

TFormComponents extends Record<string, ComponentType<any>>

Parameters

__namedParameters

CreateFormHookProps<TComponents, TFormComponents>

Returns

object

useAppForm()

ts
useAppForm: <TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>(props) => AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, TComponents, TFormComponents>;
useAppForm: <TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>(props) => AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, TComponents, TFormComponents>;

Type Parameters

TFormData

TFormData

TOnMount

TOnMount extends FormValidateOrFn<TFormData> | undefined

TOnChange

TOnChange extends FormValidateOrFn<TFormData> | undefined

TOnChangeAsync

TOnChangeAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnBlur

TOnBlur extends FormValidateOrFn<TFormData> | undefined

TOnBlurAsync

TOnBlurAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnSubmit

TOnSubmit extends FormValidateOrFn<TFormData> | undefined

TOnSubmitAsync

TOnSubmitAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnDynamic

TOnDynamic extends FormValidateOrFn<TFormData> | undefined

TOnDynamicAsync

TOnDynamicAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnServer

TOnServer extends FormAsyncValidateOrFn<TFormData> | undefined

TSubmitMeta

TSubmitMeta

Parameters

props

FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>

Returns

AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, TComponents, TFormComponents>

withFieldGroup()

ts
withFieldGroup: <TFieldGroupData, TSubmitMeta, TRenderProps>(__namedParameters) => <TFormData, TFields, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TFormSubmitMeta>(params) => ReactNode | Promise<ReactNode>;
withFieldGroup: <TFieldGroupData, TSubmitMeta, TRenderProps>(__namedParameters) => <TFormData, TFields, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TFormSubmitMeta>(params) => ReactNode | Promise<ReactNode>;

Type Parameters

TFieldGroupData

TFieldGroupData

TSubmitMeta

TSubmitMeta

TRenderProps

TRenderProps extends object = { }

Parameters

__namedParameters

WithFieldGroupProps<TFieldGroupData, TComponents, TFormComponents, TSubmitMeta, TRenderProps>

Returns

ts
<TFormData, TFields, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TFormSubmitMeta>(params): ReactNode | Promise<ReactNode>;
<TFormData, TFields, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TFormSubmitMeta>(params): ReactNode | Promise<ReactNode>;
Type Parameters
TFormData

TFormData

TFields

TFields extends | string | { [K in string | number | symbol]: DeepKeysOfType<TFormData, TFieldGroupData[K]> }

TOnMount

TOnMount extends FormValidateOrFn<TFormData> | undefined

TOnChange

TOnChange extends FormValidateOrFn<TFormData> | undefined

TOnChangeAsync

TOnChangeAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnBlur

TOnBlur extends FormValidateOrFn<TFormData> | undefined

TOnBlurAsync

TOnBlurAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnSubmit

TOnSubmit extends FormValidateOrFn<TFormData> | undefined

TOnSubmitAsync

TOnSubmitAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnDynamic

TOnDynamic extends FormValidateOrFn<TFormData> | undefined

TOnDynamicAsync

TOnDynamicAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnServer

TOnServer extends FormAsyncValidateOrFn<TFormData> | undefined

TFormSubmitMeta

TFormSubmitMeta

Parameters
params

PropsWithChildren<NoInfer<TRenderProps> & object>

Returns

ReactNode | Promise<ReactNode>

withForm()

ts
withForm: <TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, TRenderProps>(__namedParameters) => FunctionComponent<PropsWithChildren<NoInfer<UnwrapOrAny<TRenderProps>> & object>>;
withForm: <TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, TRenderProps>(__namedParameters) => FunctionComponent<PropsWithChildren<NoInfer<UnwrapOrAny<TRenderProps>> & object>>;

Type Parameters

TFormData

TFormData

TOnMount

TOnMount extends FormValidateOrFn<TFormData> | undefined

TOnChange

TOnChange extends FormValidateOrFn<TFormData> | undefined

TOnChangeAsync

TOnChangeAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnBlur

TOnBlur extends FormValidateOrFn<TFormData> | undefined

TOnBlurAsync

TOnBlurAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnSubmit

TOnSubmit extends FormValidateOrFn<TFormData> | undefined

TOnSubmitAsync

TOnSubmitAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnDynamic

TOnDynamic extends FormValidateOrFn<TFormData> | undefined

TOnDynamicAsync

TOnDynamicAsync extends FormAsyncValidateOrFn<TFormData> | undefined

TOnServer

TOnServer extends FormAsyncValidateOrFn<TFormData> | undefined

TSubmitMeta

TSubmitMeta

TRenderProps

TRenderProps extends object = { }

Parameters

__namedParameters

WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, TComponents, TFormComponents, TRenderProps>

Returns

FunctionComponent<PropsWithChildren<NoInfer<UnwrapOrAny<TRenderProps>> & object>>