1function tick() {
2 const element = (
3 <div>
4 <h1>Hello, world!</h1>
5 <h2>It is {new Date().toLocaleTimeString()}.</h2>
6 </div>
7 );
8 ReactDOM.render(element, document.getElementById('root'));
9}
10
11setInterval(tick, 1000);