Last active
November 10, 2024 19:15
-
-
Save cozos/d6636a93cba29c77e3221f2ca30212b0 to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
var ExampleApplication = React.createClass({ | |
render: function() { | |
var elapsed = Math.round(this.props.elapsed / 100); | |
var seconds = elapsed / 10 + (elapsed % 10 ? '' : '.0' ); | |
var message = | |
'React has been successfully running for ' + seconds + ' seconds.'; | |
return <p>{message}</p>; | |
} | |
}); | |
var start = new Date().getTime(); | |
setInterval(function() { | |
ReactDOM.render( | |
<ExampleApplication elapsed={new Date().getTime() - start} />, | |
document.getElementById('container') | |
); | |
}, 50); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment