Is a JSX element the same thing as an HTML element?

Question

Is a JSX element the same thing as an HTML element?

Answer

A JSX element is not the same thing as an HTML element - a JSX element is a description of what we want to see on our page.

11 Likes

isn’t that kind of like what an html element is? A representation of what you want to appear on your screen.

3 Likes

Technically, I would say a JSX element looks like an HTML element but instead a JSX element is found inside a javascript file. So, whenever you see an HTML element inside a javascript file, remember that it is a JSX element.

8 Likes

JSX is look like HTML, but is not same the html in JSX is javaScript file but browsers can’t read

In syntax, HTML elements are wrapped in <html>.

I would look at it as an HTML element being used in a JavaScript file, but described in a different way because it’s inside of JavaScript. This wouldn’t work inside of an HTML file, which is why we need the JSX compiler to have code like that translated for the browser to read.

You could probably also say that any HTML element we see inside a JS file would be referred to as a JSX element. Notice that these JSX elements aren’t surrounded by strings.

Hope this makes sense.