Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FormConfigWithInitialValues<Data>

Configuration object when initialValues is set. Used when using the data store to bind to form inputs.

Type parameters

Hierarchy

Indexable

[key: string]: unknown

Configuration object when initialValues is set. Used when using the data store to bind to form inputs.

Index

Properties

Optional extend

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

Optional function/s to extend Felte's functionality.

initialValues

initialValues: Data

Initial values for the form. To be used when not using the form action.

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