observeFormState()
Registers a two-way binding between a view property and a bound form state field.
observeFormState(
formState: Binding<FormState | undefined>,
formField: string,
property: string & keyof TView,
formChanged?: (formState: FormState) => unknown,
): void;
Parameters
- formState — A binding to a form state object (e.g. on an activity).
- formField — The name of the form field to which the value should be bound.
- property — The view property to bind to.
- formChanged — A function that will be called when the form state is updated, which should take the current form state object and return the value to be set on the view’s own property; if not provided, the value will be set directly using the form field.
Related
class Initializer static
A class that handles the initialization and configuration of views, as part of a view builder.
