React hook that exposes [IMask](https://github.com/uNmAnNeR/imaskjs) object
``bash`
npm install use-imask
or if you use yarn
`bash`
yarn add use-imask
`typescript jsx
const maskOptions = { mask: Number }; // make sure options don't change on each render (use constant or useMemo or ref)
function Example() {
const [value, setValue] = useState("");
const [ ref ] = useIMask(maskOptions, {
// use onAccept callback instead of onChange to change value
onAccept: e => {
setValue(e.target.value);
},
});
return (
);
}
``
|name|type|description|
|---|---|---|
|ref|RefObject\
|maskRef|RefObject\