Component for notify user about errors.
ErrorTip
should be wrapped into FormGroup
By default renders <span />
. All props for <span />
are valid for ErrorTip
.
children
- Only function allowed. Error text is passing as argument.
If error isn't exist, ErrorTip
wouldn't render anything
<Form
onSubmit={async (values) => await someRequest(values)}
validator={new SchemaValidator(ExampleSchema)}
errorParser={(error) => myCustomParser(error)}
>
<FormGroup attribute="surname" >
<ErrorTip>
{(error) => <p>{error}</p>}
</ErrorTip>
</FormGroup>
</Form>