Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
if (countries && countries.length > 0) {
if (customer.addresses.length === 0) {
// Get country by locale
const userCountryByLocale = RNLocalize.getCountry();
const isUserCountrySupported = countries.find(country => country.id === userCountryByLocale);
if (isUserCountrySupported) {
setValues({
...form,
firstName: customer.firstname,
lastName: customer.lastname,
country: isUserCountrySupported.id,
state: '',
});
}
}
}
}, [countries]);
}
return (
render() {
return (
detect: () =>
RNLocalize.getLocales().find(locale => locale.countryCode === RNLocalize.getCountry())
.languageCode || localesConfig.fallbackLng,
cacheUserLanguage: Function.prototype