3 ms·
It wouldn't work with Typescript, but this is what my vanilla CoffeeScript React code looks like: div className: 'navbar-form' style:
by rattray 12y ago
It wouldn't work with Typescript, but this is what my vanilla CoffeeScript React code looks like:
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'
(For the curious, "wpm" is short for "words per minute" - this is straight out of my code for http://splashreaderapp.com http://splashreaderapp.com. More code at http://github.com/rattrayalex/splashreaderapp http://github.com/rattrayalex/splashreaderapp)
- rapind 12y agoPretty 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'