react-native-phone-input
react-native-phone-input copied to clipboard
scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.
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} > <View /> </CountryPicker> </View> ) } ``
Any update ?