App crashes when using react native picker Component

Viewed 1452

Hello all for listing some items within drop down menu I'm using react native picker component , but the thing is when I changed the label and value component the app crashes.Following is my customized code.Please check and help me.

updated code

     render(){
   const data_id =  this.state.workers.map(a => a.worker_id);
   console.log(data_id);
    return(

        <View style={{flex:1}}>

           <Card>
             <CardSection>
               <Text style={{fontSize:16,padding:3}}>{this.props.Work_Category}</Text>
               <View>

               <Dropdown
                 label="select worker"
                 data={data_id}
                  />
               </View>
             </CardSection>
           </Card>
        </View>
    );
  }
}

When ever I changed the value and label component of Picker like the way above , the app crashes.Otherwise there will be no problem if the value and label components are strings.I don't whats wrong.Please..help..

0 Answers
Related