Last active
December 27, 2016 16:55
-
-
Save nayunhwan/39569b4c5f67ea77438e7a789db73255 to your computer and use it in GitHub Desktop.
React Reference TickingClock Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment