formatResult
function can help. formatResult
wraps a supplied validator and uses a specified result formatter function to augment or transform the result from the validator.formatResult
function accepts two parameters:formatResult.bind()
with a result formatter function.validate
function.{value, context}
where value
is the value that was validated and context
is the validation context provided.formatResult
can be used to augment the result of a very basic validator. The formatter uses the validated value
to generate a message
validation result prop.