Maskin react
Maskin module for working with React applications. It provides useful stuff like masking components for you to use within your React projects.
Installing
npm i -S @maskin/react
#or
yarn add @maskin/react
Mask
component
The The Mask
component is a higher-order component that uses the children render
pattern
to keep logic into the component but it delegates the responsibility of
rendering to the children.
Example:
import { Mask } from "@maskin/react";
<Mask pattern="###-xxx">
{({ value, handleChange }) => (
<input type="text" value={value} onChange={handleChange} />
)}
</Mask>
Input
component
The The Input
component is a useful component for quick usage of masking.
Example:
import { Input } from "@maskin/react";
<Input mask="xxx.xxx-##" />