I am using picker-module in React native. I have to create a dataset for this. It is okay to write Dataset with my hand, but when I print it with for for a list, I get the following error. What is the solution?
//working
const dataset = [
{
value: "1",
label: "1",
},
{
value: "2",
label: "2",
},
{
value: "3",
label: "3",
}
]
//not working
for (let i = 0; i < 3; i++) {
this.setState({yearList:this.state.yearList.push({value:`${i}`,label:`${i}`})})
}
