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