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

Provide top level support for field warning functions

Open
#714 0 comments 2 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?

In order to have warnings on fields, every form must manually include a mutator ( as per example at https://codesandbox.io/s/m5qwxpr6o8)

### What is the expected behavior?

Fields should accept a `warn` function prop (similar to redux-form).

### Sandbox Link

This is as close as I've gotten to making the warning function reusable (my project uses field wrappers to ensure consistent error display etc, so I've broken the sandbox up to show this in play)

The problem is `mutators` is empty in the `FieldHolder`
Another issue is the `mutators` prop has to be handed down through every component between the Form and the item that holds the field - would a context be a better way to handle this?

https://codesandbox.io/s/silly-a-jtb6g-jtb6g

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.