0

Following is My JSON response format .

              data:[             
                    {status: "ACTIVE", zipcode: "500019", country: "India", city: "Hyderabad"}

                     {status: "ACTIVE", zipcode: "500026", country: "India", city: "Hyderabad"}

                    {status: "ACTIVE", zipcode: "500028", country: "India", city: "Hyderabad"}
                        ]

I have tried the following code but to vain I don't find the expected results. i get the following error Expected an assignment or function call and instead saw an expression no-unused-expressions

         {this.props.bkList && this.props.bkList['data'] && this.props.bkList['data'].map(row=>{                                  

                                return(

                                    <TableRow key={row.bankId}
                                    hover
                                    onClick={() => this.handleViewDetail(row.bankId)}
                                    >
                                    {Object.keys(row).forEach(function (key){
                                        console.log(row[key]);
                                        <TableCell>{row[key]}</TableCell>

                                    })}


                                        <TableCell>
                                            <Button variant="contained" className={classes.button} onClick={(e)=>this.handleViewBranches(row.bankCode,e)}>
                                                View
                                            </Button>
                                        </TableCell>
                                    </TableRow>
                                 )

                            })}                            
                        </TableBody>

Can anyone please lemme know where I'm going wrong?

anonomous
  • 27
  • 7
  • What you're expecting is not valid JSON. The original data is. Why not use it as it is? – Kraylog Jan 09 '19 at 05:20
  • possible duplicate of https://stackoverflow.com/questions/45568649/how-to-create-array-of-json-object-without-key-in-javascript – Jayavel Jan 09 '19 at 06:07

0 Answers0