Skip to content

Instantly share code, notes, and snippets.

@StoneCypher
Created January 19, 2016 17:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save StoneCypher/ac4a029de27379e53a57 to your computer and use it in GitHub Desktop.
Save StoneCypher/ac4a029de27379e53a57 to your computer and use it in GitHub Desktop.
var counter = 0,
repaint = () => React.render(document.body, <Spinner data={counter}/>),
inc = () => { counter += 1, repaint() },
dec = () => { counter -= 1, repaint() },
Spinner = React.createClass({
render: function() {
return <div>
{this.props.data}
<button value="^" onclick={inc}/>
<button value="v" onclick={dec}/>
</div>;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment