Closed shellord closed 1 year ago
the value and default value is not working, but you can use the textInputProps like below
const [phoneInputState, setPhoneInputState] = useState<string>("0000");
<PhoneInput
textInputProps={{
value: phoneInputState
}}
onChangeText change the state value:
function onChangePhoneNumber(text: string) {
// allowed only numbers .. or whatever you want.
const value = text.replace(/\D/g, "");
setPhoneInputState(value);
}
Thanks for the solutions.
Cant change value with onChangeValue.
this doesnt work