Skip to main content

UseGeneratedForm

This hook is used to create a form from a document and an entity. It will create a form with the fields defined in the document's input type. It will also create a submit handler that will submit the form to the server.

This hook is mostly used internally by the higher-level useDetailPage hook, but can in some cases be useful to use directly.

Example

Tsx
Signature

Parameters

options

parameterGeneratedFormOptions<T, VarName, E>

Options for the useGeneratedForm hook.

Signature

document

propertyT

The document to use to generate the form.

varName

propertyVarName

The name of the variable to use in the document.

entity

propertyE | null | undefined

The entity to use to generate the form.

customFieldConfig

propertyany[]

setValues

property( entity: NonNullable<E>, ) => WithLooseCustomFields< VarName extends keyof VariablesOf<T> ? VariablesOf<T>[VarName] : VariablesOf<T> >

onSubmit

property( values: VarName extends keyof VariablesOf<T> ? VariablesOf<T>[VarName] : VariablesOf<T>, ) => void
Was this chapter helpful?
Report Issue
Edited Feb 23, 2026ยทEdit this page