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

133
Visualizações
onValueChange is not called on dynamically generated picker items

I am loading in picker items from an arraylist that gets it's data from an firebase subscriber function.

<Picker 
   selectedValue={this.state.projectName}
   onValueChange={(itemValue) => this.temptemp(itemValue)}
   style={styles.picker}>
   {this.state.projectList.map(project =>
      <Picker.Item label={project.data().name} value={project.id} />)}
</Picker>

In my constructor:

this.subscriber = firebase.firestore().collection('users').doc(auth.currentUser.uid).onSnapshot(doc => {
            this.setState({projects: doc.data().projects})
            this.getProjectNames();
        })

Once I add an item from the picker to my firestore I do not want it to show up in my picker anymore. So, the subscriber function retrieves the projects that should be displayed again. However, once this happens the onValueChange is not called again. Which results in old projects (that are no longer displayed) being added again.

How can i retrieve data from the picker when dynamically loading its picker items?

about 4 years ago · Juan Pablo Isaza
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