ErrorTip
June 21, 2019 ยท View on GitHub
Component for notify user about errors.
ErrorTip should be wrapped into FormGroup
Public interface
Props
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
Example
<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>