In documentation it is stated that it should return some arbitrary object
Submits the form if there are currently no validation errors. It may return undefined or a Promise depending on the nature of the onSubmit configuration value given to the form when it was created.
() => Promise<?Object> | void
And in react-final-form docs it is stated that submit callback (its promise returning variant):
Returns a Promise<?Object> that resolves with no value on success or resolves with an Object of submission errors on failure. The reason it resolves with errors is to leave rejection for when there is a server or communications error.
I believe that submit callback is not constrained by returning the result of type FormValues | undefined.
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
Currently we have the following FormApi type:
What is the expected behavior?
In documentation it is stated that it should return some arbitrary object
And in react-final-form docs it is stated that submit callback (its promise returning variant):
I believe that submit callback is not constrained by returning the result of type
FormValues | undefined
.Should not it be typed like this?