I experimented with this framework today and found quite significant bug. Given the following component:
const MaskExample = () => {
const [value, setValue] = useState("");
console.log("value", value);
return (
<input
type="text"
value={value}
onChange={(e) => {
setValue(e.target.value);
}}
ref={withMask("numeric", {
groupSeparator: " ",
rightAlign: false,
})}
/>
);
};
When I enter numbers, the output is reversed. So fx typing 123456 gives me the output 654 321.
The "reversing" happens, as soon as I add the onChange handler. For an uncontrolled input without onChange and value props, the component works as expected.