Defined in: packages/react-form/src/AppForm/createFormHook.public.ts:61
Configures the components and reusable defaults returned by createFormHook.
Default objects are resolved by form core before the corresponding usage-site options. Non-listener properties always take precedence, including when explicitly set to undefined. Listener arrays follow the configured listenersMerge strategy.
const { useAppForm } = createFormHook({
formComponents: {
SubmitButton,
},
fieldComponents: {
inputs: {
TextField,
},
},
defaultFormOptions: {
errorVisibility: ({ fieldState }) => fieldState.meta.isBlurred,
},
defaultFieldOptions: {
errorBoundary: true,
},
})
// Form components are flat; field components retain their namespaces:
// <form.SubmitButton />
// <field.inputs.TextField />TFormComponents extends ReactFormComponents
Library-managed. Do not specify explicitly.
TFieldComponents extends ReactComponentTree
Library-managed. Do not specify explicitly.
optional defaultFieldOptions?: DefaultFieldOptions;Defined in: packages/react-form/src/AppForm/createFormHook.public.ts:101
Defaults for every field and array-field component owned by the form.
Non-listener options passed to the component override these defaults, including when explicitly set to undefined. Listener arrays follow listenersMerge. This includes group.Field and group.ArrayField.
defaultFieldOptions: {
errorVisibility: ({ fieldState }) => fieldState.meta.isBlurred,
},optional defaultFormGroupOptions?: DefaultFormGroupOptions;Defined in: packages/react-form/src/AppForm/createFormHook.public.ts:117
Defaults for every form.FormGroup component.
Options passed to the component override these defaults, including when an option is explicitly undefined.
defaultFormGroupOptions: {
onSubmitInvalid: ({ groupApi }) => {
console.error('Invalid group', groupApi.name)
},
},optional defaultFormOptions?: DefaultFormOptions;Defined in: packages/react-form/src/AppForm/createFormHook.public.ts:86
Defaults for every form created by useAppForm.
Non-listener options passed to useAppForm override these defaults, including when explicitly set to undefined. Listener arrays follow listenersMerge.
defaultFormOptions: {
errorVisibility: ({ state }) => state.submissionAttempts > 0,
},fieldComponents: TFieldComponents;Defined in: packages/react-form/src/AppForm/createFormHook.public.ts:71
formComponents: TFormComponents & CompatibleFormComponents<NoInfer<TFormComponents>, TFormComponents, TFieldComponents>;Defined in: packages/react-form/src/AppForm/createFormHook.public.ts:65