I have following code:
<DetailsBox title={t('catalogPage.componentDetails.specs.used')}>
{component?.projects.map(project => {
projectList?.map(name => {
if (project.id === name.id) {
return (
<Typography variant="body2" gutterBottom classes={{}}>
{`${name.name}`}
</Typography>
);
}
});
})}
</DetailsBox>
and I got Expected to return a value at the end of arrow function, I know that it is caused by return in anonymous function, but how to refactor it?
Edit: The error is assigned to following line: projectList?.map(name => {