Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda