const root = ReactDOM.createRoot(document.getElementById('root'));
function tick() {
const element = (
<div>
<h1>Hello, world!</h1>
<h2>It is {new Date().toLocaleTimeString()}.</h2> // 重要代码
</div>
);
root.render(element);
}
setInterval(tick, 1000);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)