Embedding Expressions
JSX allows you to embed expressions between tags by surrounding the expressions with curly braces ({ }
).
var a = <div> {["foo", "bar"].map(i => <span>{i / 2}</span>)} </div>
The above code will result in an error since you cannot divide a string by a number. The output, when using the preserve
option, looks like:
var a = <div> {["foo", "bar"].map(function (i) { return <span>{i / 2}</span>; })} </div>
Please login to continue.