Your fat arrow functions
as whereas your map function
seem to luck matching closing '}'
and ')'
respectively.
After fixing that, you could make your outmost fat arrow
to become an IIFE(Immediately Invoked Function Expression).
(function () {
statements
})();
https://developer.mozilla.org/en-US/docs/Glossary/IIFE
<TableBody>
{
(() => {
const source =
selectedPerformance.length > 0
? selectedPerformance
: performance;
source.map(
(emp) => {
const isItemSelected = isSelected(emp.id);
return (
<TableRow hover key={emp._id}>
<TableCell> {emp.id} </TableCell>
</TableRow>
)
}
)
})()
}
</TableBody>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…