|
|
|
|
|
by insin
4054 days ago
|
|
> On the other hand, when using a template language I can put `foreach` loops and `if` conditions right into the template itself. And when using JSX I need to calculate the result of a `for` loop before the actual template and it looks much more complex and cumbersome. You can inline eqivalent JavaScript statements in JSX, without typical template language limitations in terms of allowed expressions or scope: {this.props.foo > 5 && <div>...</div>}
{this.props.foos.map(foo => <div>{foo}</div>)}
|
|