Showing list of checkboxes and I have to show checkbox status based on array data onload
reference code
AllGroups = [{id:1, name:one},{id:2,name:two},{id:3, name:three},{id:4,name:four}]
userCatChecked = [{id:2,name:two},{id:3, name:three}]
Checkbox status should show true/false based on userCatChecked array matching
<form>
{this.state.AllGroups((item, index) => {
// Here need condition
// if( item.id === userCatChecked.id ) {
// show true checkbox
//}else{
// show false checkbox
//}
<input type="checkbox" checked={true/false} onChange={ } />
})}
</form>
AllGroupsis Array, you can't call it