Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
React Native Country PickerView error when selecting a country

I have a country picker view component from the 'react-native-country-picker-modal' package. When I click on it it opens a list of all the countries with their flag and code, but when i click on any one of the countries i get this error "Type Error: undefined is not an object (evaluating 'countries[countryCode].name')" and "Type Error: undefined is not an object (evaluating str.indexOf)"

here is my code:

import CountryPicker from 'react-native-country-picker-modal'

const [callingCode, setCallingCode] = useState('+1')
const [countryCode, setCountryCode] = useState('US')

<CountryPicker
                            style={{ height: 40, width: 60 }}
                            countryCode={countryCode}
                            translation={'ita'}
                            withCallingCodeButton
                            withAlphaFilter
                            withFilter
                            visible={false}
                            onClose={() => {
                                //   this.setState({showCountry : false})
                            }}
                            onSelect={(country) => {
                                setCallingCode(country.cca2)
                                setCountryCode(country.callingCode)
                            }}
                        />

What am i doing wrong?

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda