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

130
Vistas
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 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