I have the following return in a react component:
render() {
return(
<div>
<div className = "category-name">
{categories.map(category =>
<p>{category.name}</p>
)}
</div>
<div className = "category-name">
{categories.map(category =>
<Playlist categoryid={category.id}/>
)}
</div>
</div>
);
}
This is displaying names of categories and then going through the array of names getting the description from the Playlist component. Could someone tell me how I would return the playlists under each name? I tried the following but it just won't work:
render() {
return(
<div>
<div className = "category-name">
{categories.map(category =>{
return (<p>{category.name}</p>,
<Playlist categoryid={category.id}/>)
}
)}
</div>
</div>
);
}