Skip to content

Interface: CreateFormOptionsWithDeps<FormDefinition> ​

Defined in: core/src/form/form-types.ts:48

Options of createForm for a definition that needs dependencies.

Extends ​

Type Parameters ​

Type Parameter
FormDefinition

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
depsreadonlyDepsOf<FormDefinition>undefinedThe root's dependencies. Replace them later with setDeps.-core/src/form/form-types.ts:50
focusElement?readonlyFocusElementOptionelement => element.focus()How an element is focused, for error focus and node.focus().CreateFormOptions.focusElementcore/src/form/form-types.ts:26
formatError?readonlyFormatErrorOptionerror => error.codeTurns an error into text, for errorMessage and error summaries.CreateFormOptions.formatErrorcore/src/form/form-types.ts:28
id?readonlystringformtree-<counter>Prefix of every DOM id in the form, as in checkout:contact.email.CreateFormOptions.idcore/src/form/form-types.ts:38
initialValue?readonlyDeepPartial<DraftOf<FormDefinition>>undefinedThe starting draft. It may be partial; anything left out starts empty.CreateFormOptions.initialValuecore/src/form/form-types.ts:40
mode?readonlyValidationMode'onTouched'When errors become visible. Definitions can override it.CreateFormOptions.modecore/src/form/form-types.ts:15
reValidateMode?readonlyReValidateMode'onChange'When errors update after a node that contains them is submitted. Until then, mode decides. Definitions can override it.CreateFormOptions.reValidateModecore/src/form/form-types.ts:22
shouldFocusError?readonlyFocusErrorOptiontrueWhere focus goes after a failed submit.CreateFormOptions.shouldFocusErrorcore/src/form/form-types.ts:24

Released under the MIT License.