Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 665 Bytes

ErrorTip.md

File metadata and controls

31 lines (22 loc) · 665 Bytes

ErrorTip

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>