Open MTajuddin96 opened 5 years ago
Getting this error when index letter is pressed on the right side.
`` const PhoneInputTest=()=>{ let phone = React.createRef() let countryPicker = React.createRef()
const [timezone, setTimeZone] = useState(momentTz.tz.guess()) const [cca2, setcca2] = useState({ cca2: 'US' }) const [phoneNumber, SetPhoneNumber] = useState('')
function onPressFlag() { countryPicker.current.openModal(); } function selectCountry(country) { phone.current.selectCountry(country.cca2.toLowerCase()); setPhoneNumber(+ ${country.callingCode}) setcca2({ cca2: country.cca2 }); }
+ ${country.callingCode}
return( <View style={{ marginLeft: 20, marginRight: 20, borderWidth: 1, borderRadius: 5, borderColor: borderColor, }}> <PhoneInput ref={phone} onPressFlag={onPressFlag} value={phoneNumber} /> <CountryPicker ref={countryPicker} onChange={value => selectCountry(value)} translation="eng" cca2={cca2.cca2}
) } ``
Any update ?
Getting this error when index letter is pressed on the right side.
`` const PhoneInputTest=()=>{ let phone = React.createRef() let countryPicker = React.createRef()
const [timezone, setTimeZone] = useState(momentTz.tz.guess()) const [cca2, setcca2] = useState({ cca2: 'US' }) const [phoneNumber, SetPhoneNumber] = useState('')
function onPressFlag() { countryPicker.current.openModal(); } function selectCountry(country) { phone.current.selectCountry(country.cca2.toLowerCase()); setPhoneNumber(
+ ${country.callingCode}
) setcca2({ cca2: country.cca2 }); }return( <View style={{ marginLeft: 20, marginRight: 20, borderWidth: 1, borderRadius: 5, borderColor: borderColor, }}> <PhoneInput ref={phone} onPressFlag={onPressFlag} value={phoneNumber} /> <CountryPicker ref={countryPicker} onChange={value => selectCountry(value)} translation="eng" cca2={cca2.cca2}