Skip to content

Instantly share code, notes, and snippets.

@berkaytheunicorn
Last active May 3, 2020 06:37
Show Gist options
  • Save berkaytheunicorn/23393af8e2385fe1d7211c082ad36737 to your computer and use it in GitHub Desktop.
Save berkaytheunicorn/23393af8e2385fe1d7211c082ad36737 to your computer and use it in GitHub Desktop.
Easy way to write React with coffee. (If you don't want to give up from jade.)
React = require “react”
$$ = React.DOM
Loader = require("./loader")
Card = React.createClass
getInitialState:()->
states =
loading:true
states
componentDidMount:()->
@setState
loading:false
render: ()->
$$.div
className:"wrapper"
,
if @state.loading
Loader
else
$$.span
className:"welcome"
,
"Welcome"
module.exports = Card
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment