Track warnings like errors
See original GitHub issueCurrently a field is either invalid or valid. In most form-heavy applications there is a grey area where a value might be outside of some “known good” parameter but not necessarily invalid, resulting in a warning that doesn’t affect form-validity but is still composed of validation functions. Extending this thinking, it’s possible that fields might have a number of meta states (with errors and warnings being just two) that can be built out of validators. One such (real-world) example is a “visibility” state: Is some condition met (or not met)? Then this field (or group of fields) should have their visibility affected.
I filed a similar issue for redux-form (which already has warnings) a while ago but have since shied away from redux-form.
I think this could be implemented in a future proof way (while retaining backwards compatibility) by introducing a new setter function and a new render prop (an object mapping validation type keys error
, warning
, etc. to objects of validation results).
Issue Analytics
- State:
- Created 6 years ago
- Reactions:30
- Comments:34 (3 by maintainers)
+1 for the issue.
Fairly big shortcoming for what is supposed to be the go-to form management library. Formik might be “very flexible” and allow you to implement this on your own. But so is vanilla html/js; I’m using a library to save time.
Pretty sure there’s enough upvotes here to say this should be more than an “enhancement”. At the very least this issue should be reopened/re-considered.