Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FormConfig<Data>

Configuration object type. initialValues is optional.

Type parameters

Hierarchy

Indexable

[key: string]: unknown

Configuration object type. initialValues is optional.

Index

Properties

Optional extend

extend: Extender<Data> | Extender<Data>[]

Optional function/s to extend Felte's functionality.

Optional initialValues

initialValues: Data

Optional onError

onError: (errors: unknown) => void | Errors<Data>

Optional function that accepts any thrown exceptions from the onSubmit function. You can return an object with the same shape Errors for a reporter to use it.

Type declaration

    • (errors: unknown): void | Errors<Data>
    • Parameters

      • errors: unknown

      Returns void | Errors<Data>

onSubmit

onSubmit: (values: Data) => void | Promise<void>

Required function to handle the form data on submit.

Type declaration

    • (values: Data): void | Promise<void>
    • Parameters

      • values: Data

      Returns void | Promise<void>

Optional reporter

reporter: Reporter<Data> | Reporter<Data>[]

Optional function/s to handle reporting errors.

Optional validate

validate: ValidationFunction<Data> | ValidationFunction<Data>[]

Optional function to validate the data.

Generated using TypeDoc