API
function metadata<TValue, TData, TPathKind extends PathKind = PathKind.Root>(
path: FieldPath<TValue, TPathKind>,
factory: (ctx: FieldContext<TValue, TPathKind>) => TData,
): MetadataKey<TData>;
function metadata<TValue, TData, TPathKind extends PathKind = PathKind.Root>(
path: FieldPath<TValue, TPathKind>,
key: MetadataKey<TData>,
factory: (ctx: FieldContext<TValue, TPathKind>) => TData,
): MetadataKey<TData>;function metadata<TValue, TData, TPathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, factory: (ctx: FieldContext<TValue, TPathKind>) => TData): MetadataKey<TData>;Creates a new MetadataKey and defines the value of the new metadata key for the given field.
@paramfactory
(ctx: FieldContext<TValue, TPathKind>) => TDataA factory function that creates the value for the metadata. This function is not reactive. It is run once when the field is created.
@returns
MetadataKey<TData>function metadata<TValue, TData, TPathKind = PathKind.Root>(path: FieldPath<TValue, TPathKind>, key: MetadataKey<TData>, factory: (ctx: FieldContext<TValue, TPathKind>) => TData): MetadataKey<TData>;Defines the value of a MetadataKey for a given field.
@paramfactory
(ctx: FieldContext<TValue, TPathKind>) => TDataA factory function that creates the value for the metadata. This function is not reactive. It is run once when the field is created.
@returns
MetadataKey<TData>Jump to details