im facing the issue when trying to implement some conditional rendering. Here is the context:
the data:
groups_a : [
{id:1} ,
{id:2}
]
groups_b : [
{id:1} ,
{id:3}
]
The condition:
I wish to be check each item in groups_b , whether they exist in groups_a . So in this case , the condition should return back true because groups_b has id:1 and so does groups_a
JSX :
{###the condition ##
?
<Button>Approve</Button>
:
null
}
groups_aandgroups_bare not valid JavaScript objects. Are you sure those variables are not type of Array? Which would make more sense.