So have a component where I try to select elements one by one.
 The element is an external component//

```
class AddItem extends React.Component {
       state = {
        selected: [],
       };

```

//here I tried a few different ways to push the selected ids to the local state if I concole.log(selectedId) I get the correct desired output but when pushed the state.selected becomes 1 and if I select an other element it brakes.

```
  handleGroupSelection = selectedId => {
     let newList = this.state.selected;
     newList = newList.push(selectedId);
     this.setState({ selected: newList });
   };

 arrayContains = id => {
    for (let item in this.state.selected) {
      if (item.id === id) {
        return true;
      }
    }
      return false;
}

 render() {
    return (
      {this.props.getSelf &&
        this.props.getSelf.groups && (
          <Grid
             container
             item
             xs={12}
             sm={8}
             md={6}
             lg={4}
             spacing={16}
          >
            <Grid item xs={12} sm={12} md={12} lg={12}>
              <ListItemText primary="My Groups:" />
            </Grid>
              {this.props.getSelf.groups.map(listItem => (
                <Grid item xs={4} sm={4} md={4} lg={4}>
                  <div
             //here I would like to add a conditional style, based on selectedIds. 

                    className={
                      this.arrayContains(listItem.id) === true
                        ? classes.layer
                        : "none"
                    }
                    onClick={() => 
                     this.handleGroupSelection(listItem.id)}
                    >
                    <GroupListItem
                      groupId={listItem.id}
                      key={listItem.id}
                      anchor={listItem.id}
                      image={listItem.image}
                      name={listItem.name}
                      disable={true}
                     />
                   </div>
                </Grid>
             ))}
    )
 }

```