Skip to content

getGlobalDefaultValues

getGlobalDefaultValues(props): Record<string, unknown>

Defined in: packages/core/src/globals/utils.ts:19

Builds defaultValues for a TanStack Form from a global config.

Mirrors getCollectionDefaultValues — operates on GlobalConfig rather than CollectionConfig. When document is provided (edit mode), uses its field values; otherwise falls back to each field’s defaultValue.

Input props.

VexDocumentGlobal<string> | null

Optional existing flat global document (edit mode). null means “no document persisted yet” — create mode with defaults.

GlobalConfig

The global config whose fields define the form shape.

Record<string, unknown>

Record<fieldKey, value> ready for useForm({ defaultValues }).