Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!