Defined in: packages/react-form/src/AppForm/createFormHookTypes.public.ts:143
Configures the components and reusable defaults returned by createFormHook.
Default objects are shallowly applied before the corresponding usage-site options. A usage-site property always takes precedence, including when its value is explicitly undefined.
const { useAppForm } = createFormHook({
formComponents: {},
fieldComponents: {
TextField,
},
defaultFormOptions: {
errorVisibility: ({ fieldState }) => fieldState.meta.isBlurred,
},
defaultFieldOptions: {
errorBoundary: true,
},
})TFormComponents extends Record<string, FunctionComponent<any>>
Library-managed. Do not specify explicitly.
TFieldComponents extends Record<string, FunctionComponent<any>>
Library-managed. Do not specify explicitly.
optional defaultFieldOptions?: CreateFormHookDefaultFieldOptions;Defined in: packages/react-form/src/AppForm/createFormHookTypes.public.ts:175
Defaults for direct form.Field and form.ArrayField components.
Options passed to the component override these defaults, including when an option is explicitly undefined. These defaults do not apply to group.Field or group.ArrayField.
defaultFieldOptions: {
errorVisibility: ({ fieldState }) => fieldState.meta.isBlurred,
},optional defaultFormGroupOptions?: CreateFormHookDefaultFormGroupOptions;Defined in: packages/react-form/src/AppForm/createFormHookTypes.public.ts:191
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?: CreateFormHookDefaultFormOptions;Defined in: packages/react-form/src/AppForm/createFormHookTypes.public.ts:160
Defaults for every form created by useAppForm.
Options passed to useAppForm override these defaults, including when an option is explicitly undefined.
defaultFormOptions: {
errorVisibility: ({ state }) => state.submissionAttempts > 0,
},fieldComponents: TFieldComponents;Defined in: packages/react-form/src/AppForm/componentMap.public.ts:8
ReactFormComponentMap.fieldComponents
formComponents: TFormComponents;Defined in: packages/react-form/src/AppForm/componentMap.public.ts:7