React - InputMask maskPlaceholder is saving as input value

467 Views Asked by At

I'm using InputMask with maskPlaceholder = {"XXX"} and when I check the currentState.value after focusing on the input, the value holds the placeholder value and not null.

I don't want the placeholder to be a part of the value itself, and before I insert any character I want the currentState.value to be null.

Tried to use maskChar={"X"} but this gives me a warning:

Warning: React does not recognize the maskChar prop on a DOM element

1

There are 1 best solutions below

0
Marcy On

I've used null instead

maskChar={null}