Skip to content
doubtly

2 answers

React does not use plain HTML directly; it uses JSX, an HTML-like syntax inside JavaScript, which React turns into real HTML elements in the browser.

Example of JSX:

function Hello() {
  return <h1 className="title">Hello, world</h1>;
}

A compiler such as Babel converts this JSX into JavaScript calls like React.createElement("h1", ...). React then creates and updates the actual HTML DOM elements on the page.

JSX looks like HTML but has some differences: className instead of class, htmlFor instead of for, camelCase event names like onClick, every tag must be closed, and JavaScript expressions go inside { }.

Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.