• React hook which exposes validation-related props to a form component

    It provides the same destructuring pattern as you may have when assigning the result of useState to a variable. The only key difference is with the additional 3rd argument which holds extra form-related and validation-related information. Most notable are isValid and errors.

    Type Parameters

    • TClass

      represents parent form class model holding context of current compontent

    Parameters

    • Class: (new (...args) => TClass)
        • new (...args): TClass
        • Parameters

          • Rest ...args: any[]

          Returns TClass

    • props: UseValidationConfig<TClass> = {}

    Returns UseValidationReturn<TClass>

    Example

    const [form, setForm, {
    errors,
    detailedErrors,
    isValid,
    engine
    }] = useValidation(MyClass)

Generated using TypeDoc