final-form / final-form/react-final-form

How to set Form's values interface?

Open
#454 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

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 {
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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.