I want ro render 3 additional buttons if the current user is the user that created the group i'm in at the moment, so i tried someting like this :
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>
)}
But this implementation raises a compiler error , how could i change up the code in order to make it work? JSX experssion must have one parent element , is the error i'm getting