Function useFormHandle

  • Hook used to gain access to form-wide methods and properties computed from all fields. Causes the component to subscribe to changes to form state that affect the computed properties.

    Type Parameters

    • Values extends object

    • Err

    Parameters

    • _Schema: FormSchema<Values, Err>
    • Optional controller: FormController

      obtained by using useFormController hook, used to connect to form state. Injected automatically via React Context when used inside FormProvider component.

    Returns FormHandle<Values, Err>

    FormHandle used to interact with form.

    Example

    const Schema = new FormSchemaBuilder()...;

    const MyForm: React.FC = () => {
    const controller = useFormController({ Schema })
    const formHandle = useFormHandle(Schema, controller)

    ...
    }

Generated using TypeDoc