How to access to the validation schema inside a FieldComponent?
Is there an easy way to leverage the validation schema inside a FieldComponent?
I'd like to know if the field is required or not, and if there are some rules like "max length"/"min length" to show a characters count.
Currently have this:
And this is my schema:
I'm looking to do something like this
I'd like to know if the field is required or not, and if there are some rules like "max length"/"min length" to show a characters count.
Currently have this:
And this is my schema:
I'm looking to do something like this
{field.{somewhere}.isOptional && <span className="italic">—<Trans>optional</Trans></span>}