Closed mk48 closed 3 years ago
The given example in the Readme.md file seems not working. I have included a code sandbox link.
Below is the document example
Code sandbox screen
Full code
import React, { useState } from "react"; import InputMask from "react-input-mask"; const firstLetter = /(?!.*[DFIOQU])[A-VXY]/i; const letter = /(?!.*[DFIOQU])[A-Z]/i; const digit = /[0-9]/; const msk = [firstLetter, digit, letter, " ", digit, letter, digit]; const Txt = () => { const [value, setValue] = useState<string>(""); const onChange = (e: any) => { setValue(e.target.value); //console.log(e); }; return ( <InputMask mask={msk} onChange={onChange} value={value} alwaysShowMask={true} /> ); }; export default Txt;
Code sandbox link https://codesandbox.io/s/input-mask-uwduh?file=/src/Txt.tsx:0-575
Am I missing anything?
It only works with the version 3.0.0-alpha.0, consider checking your version
Thanks, it's working in the 3.0.0-alpha.0
The given example in the Readme.md file seems not working. I have included a code sandbox link.
Below is the document example
Code sandbox screen
Full code
Code sandbox link https://codesandbox.io/s/input-mask-uwduh?file=/src/Txt.tsx:0-575
Am I missing anything?