vendredi 3 mars 2017

Render a table with an if condition in react

i want to render a table in react redux. To be more specific i have an accounts JSON array like this with 1- records:

[
{
    "size": "100",
    "date": "6/1/2017",
    "time": "09:23 AM",
    "status": "Working"
  },
{
    "size": "100",
    "date": "6/1/2017",
    "time": "09:23 AM",
    "status": "Completed"
  },
]

and i want to render the record with status Completed. So when i create my render Table function i write

if ((ordersTrades.map(orderTrade => orderTrade.status)) === 'Completed') {
 return (
   ...
      );
}

But it does not return anything. ordersTrades is the name of my JSON. Why is that?

Aucun commentaire:

Enregistrer un commentaire