Daniel Bird
7 years ago
3 changed files with 25 additions and 3 deletions
@ -0,0 +1,5 @@ |
|||||
|
const element = <h1>Hello, world</h1>; |
||||
|
ReactDOM.render( |
||||
|
element, |
||||
|
document.getElementById('root') |
||||
|
); |
@ -0,0 +1,17 @@ |
|||||
|
function tick() { |
||||
|
const element = ( |
||||
|
<div> |
||||
|
<h1>Hello, world!</h1> |
||||
|
<h2> |
||||
|
It is{' '} |
||||
|
{new Date().toLocaleTimeString()}. |
||||
|
</h2> |
||||
|
</div> |
||||
|
); |
||||
|
ReactDOM.render( |
||||
|
element, |
||||
|
document.getElementById('root') |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
setInterval(tick, 1000); |
Loading…
Reference in new issue