Skip to content
shaan edited this page Sep 18, 2022 · 2 revisions

tsx or jsx?

*** JSX - .jsx filename to allow for html-like syntax but must be self-closing - end in />**

<img src="" />

<br />

<hr />

*** attributes written in camelCase**

i.e. class becomes className (and always in general) <div className="container"></div>

*** inline styles use two sets of curly braces rather than double quotes ("")**

i.e. written as properties on objects <h1 style={{ fontSize: 24, margin: '0 auto', textAlign: 'center' }}>My header</h1>

Clone this wiki locally