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

307
Views
Invalid attempt to spread non-iterable instance on getting each value from picker

So I have a picker that is mapped based on items from the database and I'm trying to get the value from each picker to send it back to the database. So far I have done this:

this.state = {
            rating: null,
            arrRating:[]
        }

renderQuestion(){
        let panels = []
          this.props.companyQuestion.map((key, index) => {
            panels.push(
                <View key={index} style={styles.panel}>
                    <View style={styles.panelRow}>
                        <Text style={styles.panelText}>{key.question}</Text>
                        <Picker
                        selectedValue={this.state.rating}
                        style={styles.panelText}
                        onValueChange={(itemValue, itemIndex) =>
                            this.setState({ rating: itemValue, 
                                arrRating:[...this.state.arrRating.push(this.state.rating)] })
                        }>
                        <Picker.Item label="Score" value="0" />
                        <Picker.Item label="1" value="1" />
                        <Picker.Item label="2" value="2" />
                        <Picker.Item label="3" value="3" />
                        <Picker.Item label="4" value="4" />
                        <Picker.Item label="5" value="5" />
                        </Picker> 
                    </View>
                </View>
            );
          })
        return panels;
    }

But I am having an error when I picked an item in the picker. It says

TypeError: Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
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!