Skip to content

How to set Form's values interface? #454

@ackvf

Description

@ackvf

From the typings, I can see that Form props are of type FormProps from 'react-final-form' and that extends Config from 'final-form'. Config accepts type generics that eventually set the type of values ->

Config<FormData = object> {
  onSubmit: (values: FormData) // ...
}

How can I configure the values type from within the Form itself so that I have intellisense within onSubmit and validation handlers and everywhere else where values appear?

PS: shouldn't the values here be also of FormData

  validate?: (values: object)
  initialValues: object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions