📝 Edit page
➕ Add page
Mount app
API
See ReactDOM docs on React homepage.
render
Signature:
ReactDOM.render(element, container[, callback])
How to render an app
Given HTML as:
<body>
<div id="app">
</div>
</body>
With JSX
function Welcome() {
return (
<p>
Hello, World!
</p>
);
}
ReactDOM.render(
<Welcome />,
document.getElementById('app')
);
Without JSX
function Welcome() {
return React.createElement(
'p',
null,
'Hello, World!',
);
}
ReactDOM.render(
React.createElement(Welcome, null),
document.getElementById('app')
);