Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nguyenvanduocit
Created April 16, 2016 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nguyenvanduocit/d8d1b4490422df2ec9cb286f1441d677 to your computer and use it in GitHub Desktop.
Save nguyenvanduocit/d8d1b4490422df2ec9cb286f1441d677 to your computer and use it in GitHub Desktop.
var Greeting = React.createClass({
render: function() {
return (
<p>{this.props.message}</p>
);
}
});
setInterval(function() {
var messages = ['Hello, World', 'Hello, Planet', 'Hello, Universe'];
var randomMessage = messages[Math.floor((Math.random() * 3))];
ReactDOM.render(
<Greeting message={randomMessage}/>,
document.getElementById('greeting-div')
);
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment