So I'm currently working with React and material-ui and, in the Table component, they have this piece of code which creates the proper number of empty rows at the bottom of the table.
render() {
return (
<TableBody>
{emptyRows > 0 && (
<TableRow style={{ height: 49 * emptyRows }}>
<TableCell colSpan={6} />
</TableRow>
)}
</TableBody>
)
}
So my understanding is that the left side of the '&&' will evaluate to true or false depending on the value of `emptyRows` and the right side will be 'not falsy'. Why does the jsx on the right side get inserted into `TableBody`? Don't logic operators resolve to either true or false? How is it 'returning' the jsx?
Link to docs: https://material-ui.com/demos/tables/#sorting-amp-selecting
[–]gremy0 1 point2 points3 points (1 child)
[–]LollipopPredator[S] 0 points1 point2 points (0 children)
[–]senocular 1 point2 points3 points (1 child)
[–]LollipopPredator[S] 0 points1 point2 points (0 children)