Last active
October 17, 2017 20:13
-
-
Save JimCMorrison/52a7430979c3fdf415a57946f80cd32a to your computer and use it in GitHub Desktop.
A quick React gist of a clock.
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 clock(){ | |
const tick = ( | |
<div> | |
<h1>The Time is:</h1> | |
<h2>time: {new Date().toLocaleTimeString()}</h2> | |
</div> | |
); | |
ReactDOM.render( | |
tick, | |
document.getElementById('root') | |
); | |
} | |
setInterval(clock, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment