## Installation
```
yarn add @comparaonline/ui-form-errors
This package exposes a ErrorMessages context using ErrorMessageProvider andErrorMessagesConsumer. A utility called replacer can be used to use templates that follow this convention
`ts`
'The min value is {{minValue}} and the maxValue is {{maxValue}}'
... in your ErrorMessagesConsumer.
`tsx
import { ErrorMessagesProvider } from '@comparaonline/ui-form-errors';
interface ErrorMessages = {
[errorCode: string]: string
}
const errorMessages: ErrorMessages = {
required: 'This field is required',
outOfRange: 'The min value is {{minValue}} and the maxValue is {{maxValue}}'
}
...
`
`tsx``
{({ errorMessages }) => ()}