Closed akinncar closed 5 years ago
Hi, please provide a code sample.
I was copying my code to provide and I found my error, the default state of value provide in Input was false, but the correct is "", look:
Wrong:
import { InputMask } from "react-native-masked-text";
const [registerNumber, setRegisterNumber] = useState(false); // error here
<InputMask
mask="cpf"
keyboardType="numeric"
placeholder={`Digite seu CPF`}
value={registerNumber}
onChangeText={setRegisterNumber}
/>
Correct:
import { InputMask } from "react-native-masked-text";
const [registerNumber, setRegisterNumber] = useState(""); // solve here
<InputMask
mask="cpf"
keyboardType="numeric"
placeholder={`Digite seu CPF`}
value={registerNumber}
onChangeText={setRegisterNumber}
/>
When I try to use cpf and cnpj mask on react-native 0.60, my screen don't render without errors. In the same input, if I try to use cel-phone or only-numbers mask, it works. Somebody have idea to solve or maybe has been through it???
I'm using react-native-masked-text: 1.12.4