max
Last updated
Was this helpful?
Last updated
Was this helpful?
The max
validator checks that a numeric value is at most the maximum value provided.
If the value being validated is null
, false
, an empty string, or another falsy value other than 0
, then the result will be valid. This respects the rule of thumb described in the notes for the validator.
max
: The maximum value compared against
The max
validator supports three parameter signatures:
max(value)
where the value is used as the max
named prop
max(propsObject)
where the props object contains a max
named prop
max(propsFunction)
where the props function returns a props object with a max
named prop