score:1

Accepted answer
render() {
  let adminButtons;
  if (this.state.groupData && this.props.user.id){
    if (this.state.groupData.owner === this.props.user.id){
      adminButtons = [
        <CustomButton>Add Quiz</CustomButton>,
        <CustomButton>Drafts</CustomButton>,
        <CustomButton>Delete Group</CustomButton> ];
    } else {
      adminButtons = <div/>;
    }
  }

  return(
    <div className='group-page'>
      <div className='group-controls'>
        <div className='admin-buttons'>
          {adminButtons}
        </div>   
      </div>      
  </div>
)}

score:-1

    let adminButtons = null;
    if (this.state.groupData && this.props.user.id){
        if(this.state.groupData.owner === this.props.user.id){
            adminButtons = <>
                <CustomButton>Add Quiz</CustomButton>
                <CustomButton>Drafts</CustomButton>
                <CustomButton>Delete Group</CustomButton> };
        </>
        }
    }

score:1

adminButtons = [
                    <CustomButton>Add Quiz</CustomButton>
                    <CustomButton>Drafts</CustomButton>
                    <CustomButton>Delete Group</CustomButton> };
            ]

score:3

 <>
  <CustomButton>Add Quiz</CustomButton>
  <CustomButton>Drafts</CustomButton>
  <CustomButton>Delete Group</CustomButton>
</>

Related Query

More Query from same tag