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

Feature request: new render prop `handleSubmitSync`

Open
#1,005 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### Are you submitting a **bug report** or a **feature request**?

Feature request

### What is the current behavior?

This code

```

{props => (

... fields go here...

Submit

)}

```

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?

```
react@18.2.0
final-form@4.20.7
react-final-form@6.5.9
eslint@8.21.0
@typescript-eslint/eslint-plugin@5.32.0
```

Contributor guide

Open the contributing guide

Research direction

Search the render-prop API entry point for the existing handleSubmit implementation and inspect how its return value is handled. Add the requested handleSubmitSync behavior so it always returns undefined while preserving submission, then verify the ESLint no-misused-promises use case and existing submit behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript, react
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.