react-final-form icon indicating copy to clipboard operation
react-final-form copied to clipboard

Feature request: new render prop `handleSubmitSync`

Open vtaits opened this issue 3 years ago • 0 comments

Are you submitting a bug report or a feature request?

Feature request

What is the current behavior?

This code

<Form onSubmit={onSubmit}>
  {props => (
    <form onSubmit={props.handleSubmit}>

      ... fields go here...

      <button type="submit">Submit</button>
    </form>
  )}
</Form>

conflicts with eslint rule @typescript-eslint/no-misused-promises

https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.md

What is the expected behavior?

I suggest to add new render prop handleSubmitSync that wraps handleSubmit and always returns undefined.

What's your environment?

[email protected]
[email protected]
[email protected]
[email protected]
@typescript-eslint/[email protected]

vtaits avatar Aug 15 '22 16:08 vtaits