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

Add a nicer API to Perform Form actions outside of render

Open
#551 5 comments 3 reactions 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?

Currently you have to stuff that feels hacky https://github.com/final-form/react-final-form/blob/master/docs/faq.md#how-can-i-trigger-a-submit-from-outside-my-form

With hooks out there I think we could get a better, first class API. It could look like this

```javascript
function TestForm() {
// ...
const formApi = useFormApiRef();
return (


{/*...*/ }}
render={() =>
}
/>
{
formApi.reset();
}}>outsider button

);
}
)
```

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.