<div id="root">
<!-- This element's contents will be replaced with your component. -->
</div>
function tick() {
const element = (
<div>
<h1>Hello, world!</h1>
<h2>It is {new Date().toLocaleTimeString()}.</h2>
<>
{(() => {
if (true) {
return (
<h2>Hi!</h2>
)
}
})()}
</>
</div>
);
ReactDOM.render(
element,
document.getElementById('root')
);
}
setInterval(tick, 1000);
View Compiled
This Pen doesn't use any external CSS resources.