What does ReactDOM.createRoot do?
It creates a root that connects React to a real DOM element. Calling render on that root turns your JSX description into actual DOM nodes. It is the bridge between React's virtual UI and the browser.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in How to Write Your First React Hello World Program
Load React and ReactDOM from a CDN, create a root on a DOM element using ReactDOM.createRoot, and call root.render with a JSX element like <h1>Hello World</h1>. That is the simplest React Hello World.
No. JSX looks like HTML but it is syntax that compiles to JavaScript function calls, specifically React.createElement. Small differences exist, like using className instead of class, because JSX is JavaScript.
A CDN lets you start writing React immediately without setting up build tools. It keeps the focus on React concepts. However, the CDN approach is only for learning; real projects use a bundler like Parcel or Vite.
Still have questions?
Browse all our FAQs or reach out to our support team
