Files
form/docs/framework/react/reference/useForm.md
2023-05-04 15:39:15 -07:00

812 B

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 listen function to be called with the form state.

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 FormProps as an argument and returns a form component.