Skip to content

Instantly share code, notes, and snippets.

@joaomilho
Last active August 29, 2015 14:13
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 joaomilho/c734572480db348ee968 to your computer and use it in GitHub Desktop.
Save joaomilho/c734572480db348ee968 to your computer and use it in GitHub Desktop.
Counter = React.createClass
getInitialState: ->
count: 0
increment: ->
@setState(count: @state.count + 1)
render: ->
<div>
{ @state.count }
<button onClick={ @increment }>+</button>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment