Skip to content

Instantly share code, notes, and snippets.

@chrisvfritz
Last active August 24, 2016 16:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvfritz/f3e76764c920325638fc to your computer and use it in GitHub Desktop.
Save chrisvfritz/f3e76764c920325638fc to your computer and use it in GitHub Desktop.
# Since React has made jQuery obsolete for me, I use $ to replace JSX.
window.$ = React.create-element
for key, value of React.DOM
window."$#key" = value
# And here's an example of a render function using this syntax.
render: ->
$ Jumbotron, style: styles.welcome.base, [
$h2 key: \tagline, 'this is a catchy tagline'
$p key: \mission, 'here is a short mission statement, expanding on the tagline'
$a key: \demo-link, href: '/demo', do
$ Button,
bs-style: \primary
bs-size: \large
'Try the demo'
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment