Re:React v0.13.0 Beta 1
by rattray on Wednesday January 28, 2015 @07:02AM
(#8959319)
It wouldn't work with Typescript, but this is what my vanilla CoffeeScript React code looks like:
(For the curious, "wpm" is short for "words per minute" - this is straight out of my code for http://splashreaderapp.com. More code at http://github.com/rattrayalex/splashreaderapp)
[ Parent
| on HN ]
Pretty sure you can lose all of those single line "," and make it a bit nicer.
div
className: 'navbar-form'
style:
backgroundColor: "green"
div
className: 'btn-group'
button
type: 'button'
className: 'btn btn-warning'
onClick: @handleDecreaseWpmClick
span
className: 'glyphicon glyphicon-chevron-down'
span
className: 'btn btn-default disabled'
"#{ @props.status.get('wpm') }"
span
className: 'hidden-xs'
" wpm"
button
type: 'button'
className: 'btn btn-warning'
onClick: @handleIncreaseWpmClick
span
className: 'glyphicon glyphicon-chevron-up'