390885 (23) [Avatar] Offline
#1
I have seen such code snippet in chapter 3 like
<h1>1. Hello world!</h1>

and
<span>Current date and time is {dateTimeNow}.</span>


There are no quotation marks around the text in the tags.
Why?
I can use babel to do the transformation and it works well.
There are quotation marks in the output JS though.
capouch (10) [Avatar] Offline
#2
Because JSX is a "mixture," if you will, of HTML and JavaScript. The only part of the above content that is "JavaScript" is the {dateTimeNow} token; the rest is straight HTML, and as such, doesn't have to be quoted because it's not JavaScript.
390885 (23) [Avatar] Offline
#3
capouch wrote:Because JSX is a "mixture," if you will, of HTML and JavaScript. The only part of the above content that is "JavaScript" is the {dateTimeNow} token; the rest is straight HTML, and as such, doesn't have to be quoted because it's not JavaScript.

OK, got it. Thanks.