react-native-phone-input
react-native-phone-input copied to clipboard
Setting phone input value not working properly
<PhoneInput keyboardType={'numeric'} initialCountry='in' value='+91' ref={(ref) => {this.phone = ref;}} onChangePhoneNumber={(number) => {this.setState({mobile_no: number})}} />
If I try to clear the phone input completely , the number is getting cleared and only the flag is resetting. And if I again choose the same country, the country code (or dial code) is not showing up. Is there any way I fix this?
Could you please share how to reset it's value? Thanks in advance
Hello, it's possible to set an empty value through component inner set state
phoneInputRef.current!.setState({
inputValue: '',
})