mirror of
https://github.com/LukeHagar/form.git
synced 2025-12-06 12:27:45 +00:00
1.0 KiB
1.0 KiB
id, title
| id | title |
|---|---|
| useForm | useForm |
useForm
export function useForm<TData>(
opts?: FormOptions<TData> & { listen?: (state: FormState<TData>) => any },
): FormApi<TData>
A custom hook that returns an instance of the FormApi<TData> class.
opts- Optional form options and a
listenfunction to be called with the form state.
- Optional form options and a
FormProps
An object type representing the form component props.
- Inherits from
React.HTMLProps<HTMLFormElement>. children: React.ReactNode- The form's child elements.
noFormElement?: boolean- If true, the form component will not render an HTML form element.
FormComponent
A type representing a form component.
(props: FormProps) => any- A function that takes
FormPropsas an argument and returns a form component.
- A function that takes
createFormComponent
export function createFormComponent(formApi: FormApi<any>): FormComponent
A function that creates a form component with the provided form API instance.
formApi- An instance of the
FormApi<any>class.
- An instance of the