6 - JSX
6 - JSX
WHAT IS JSX ?
WHY WE USE JSX IN
REACT APP ? REACT
PRESENTER: MOHAMMAD ADIL
function Show()
{
document.write(“<h1> Hey Wassup </h1>”);
}
• The class attribute is a much used attribute in HTML, but since JSX
is rendered as JavaScript, and the class keyword is a reserved word
in JavaScript, you are not allowed to use it in JSX.
• Use attribute className instead.
• JSX solved this by using className instead. When JSX is rendered, it
translates className attributes into class attributes.
• For attribute is replace with htmlFor.
Conditions - if statements REACT