I added a join button next to each group as follows:
var publicGroupItems = publicGroups.map(group =>
<ListItem key={group._id} global href={'/groups/' + group._id} image={group.imageUrl} title={group.name} ><button type="button" onClick={this.joinGroup(group._id)}>joinGroup</button></ListItem>)
When I click on the button it goes through each of the groups ids and adds the current user to ALL groups.
How can I make it so that the user is only added to the specific group where I clicked join?
{ }code formatting option.