Skip to content

Instantly share code, notes, and snippets.

@JimCMorrison
Last active October 17, 2017 20:13
Show Gist options
  • Save JimCMorrison/52a7430979c3fdf415a57946f80cd32a to your computer and use it in GitHub Desktop.
Save JimCMorrison/52a7430979c3fdf415a57946f80cd32a to your computer and use it in GitHub Desktop.
A quick React gist of a clock.
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