Last active
May 3, 2020 06:37
-
-
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.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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