Infer required/optional from validation schema #10040
Unanswered
MerlinMason
asked this question in
Ideas
Replies: 2 comments
-
good idea! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Totally agree, I was surprised when found out this is not supported by default. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you want to consistently style required/optional form inputs differently you have to pass them a
required
prop to do so. Additionally you have to remember to ensure these props align with your validation schema (with opportunity for human error).It would be really handy if you could determine whether a given field was optional or required by inferring this from the validation schema.
Potentially this could look something like:
Be interested to hear peoples thoughts on this... Is this already possible somehow? If not, would it be feasible to implement?
Beta Was this translation helpful? Give feedback.
All reactions