For example, you can create a React element to show a heading with the text "Hello, React!" like this:
const element = <h1>Hello, React!</h1>;
element is just a plan; it's not the actual thing on the web page. To put it on the web page, you use React to render it. Here's how you do it:
const element = <h1>Hello, React!</h1>; const container = document.getElementById('root'); ReactDOM.render(element, container);
In this code,
ReactDOM.render takes your plan (the React element) and shows it on the web page inside the HTML element with the ID "root."
The important thing to remember is that React elements are like sketches, and React turns them into the real web content you see.