<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

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://unpkg.com/react/umd/react.development.js
  2. https://unpkg.com/react-dom/umd/react-dom.development.js