UseJsonFormOptions
The options of useJsonForm.
Definition
UseJsonFormOptionsbuilderSchemaBuilder: optional, builds the schema and knows your own types and rules. Defaults tocreateSchemaBuilder()componentsFieldComponents: optional, your component for each field typelayoutComponentsLayoutComponents: optional, your component for each layout typevalidateValidationMode: optional, when a field is validated the first time, as in FormischrevalidateExclude<ValidationMode, 'initial'>: optional, when it is validated again, as in Formisch
Example
ts
// Built once, outside the component: the builder is read on the first render.
const builder = createSchemaBuilder({ extensions: [affects()] })
export function useOrderForm(definition: JsonForm) {
const jsonForm = useJsonForm(definition, {
// Your own types, rules, messages and extensions. Defaults to createSchemaBuilder().
builder,
// Your component for each field type.
components,
// Your component for each layout type.
layoutComponents,
// When a field is validated the first time, and again after that, as in Formisch.
validate: 'blur',
revalidate: 'input',
})
return jsonForm
}