maxLength
The maxLength
validator checks that a string value has a length at most the maximum length provided.
If the value being validated is null
or an empty string, then the result will be valid. This respects the rule of thumb described in the notes for the required validator.
Named Props
maxLength
: The maximum length compared against
Parameters
The maxLength
validator supports three parameter signatures:
maxLength(value)
where the value is used as themaxLength
named propmaxLength(propsObject)
where the props object contains amaxLength
named propmaxLength(propsFunction)
where the props function returns a props object with amaxLength
named prop
Usage
Last updated
Was this helpful?