API reference: @salmonui/inputs/form/state
FormStateinterface
import type { FormState } from '@salmonui/inputs/form/state';interface FormState {
readonly ref: (form: HTMLFormElement | null) => (() => void) | undefined;
readonly isDirty: boolean;
readonly dirtyFields: readonly string[];
readonly isFieldDirty: (name: string) => boolean;
readonly reset: () => void;
}
What useFormState() returns.
| Name | Signature | Description |
|---|---|---|
ref | readonly ref: (form: HTMLFormElement | null) => (() => void) | undefined; | Attach to the |
isDirty | readonly isDirty: boolean; | True while any field differs from its initial value. |
dirtyFields | readonly dirtyFields: readonly string[]; | Names of the fields whose values differ from the initial ones, in form order. |
isFieldDirty | readonly isFieldDirty: (name: string) => boolean; | Whether the field |
reset | readonly reset: () => void; | Resets the form ( |