@comparaonline/ui-text-masks
v3.2.0
Published
> Package purpose
Downloads
80
Maintainers
Keywords
Readme
@comparaonline/ui-text-masks
Package purpose
Installation
yarn add @comparaonline/ui-text-masks
Usage
You need import from ui-text-mask the withTextMask
HOC and passing a valid mask. You can import a predefined mask from ui-text-mask or make your custom one. If you want use a custom mask, be careful to implement maskArray
type from 'react-text-mask' to complete a valid mask.
Here is the list of predefined masks:
CNPJ
CEP
CPF
CellPhone
BirthDay
import React from 'react';
import { withTextMask, CNPJ } from '@comparaonline/ui-text-masks';
const CNPJInputMask = withTextMask(CNPJ);
export const RenderCNPJInputMask: React.SFC = () => <CNPJInputMask />