DEV Community

Cover image for JSX and Rendering elements
Aditya Sharan
Aditya Sharan

Posted on

1 2

JSX and Rendering elements

Alt Text
This is neither a string nor HTML,it's JSX.

JSX or Javascript XML, is an XML/HTML-like syntax used by react that extends ECMAScript(ES) so that XML/HTML-like-text can co-exist with Javascript/React code.


Since JSX is closer to Javascript than to HTML,ReactDOM uses camelCase property naming convention instead of HTML attribute names.
For eg :
class becomes className
tabindex becomes tabIndex


Let's say there is a somewhere in your HTML file :

Alt Text

# This is the 'root' DOM node because everything inside it will be managed by ReactDOM.

To render a React element into a root DOM node, pass both to ReactDOM.render() :
Alt Text
Running you react app after this will give the following output :
Alt Text

That's all folks.
Thanks for reading!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay