Last active
August 29, 2015 14:08
-
-
Save namuol/61c5f9690fd20351ced9 to your computer and use it in GitHub Desktop.
CoffeeX Syntax Concept (JSX for CoffeeScript)
This file contains 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
MySimpleComponent = React.createClass | |
render: -> <pre>{@props.mytext}</pre> | |
MyComponent = React.createClass | |
render: -> | |
<ul> | |
@props.items.map (item) => | |
<li><a href="#" onClick={@props.handleClick}>{item}</a></li> | |
</ul> |
This file contains 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
/** @jsx React.DOM */ | |
MySimpleComponent = React.createClass({ | |
render: function () { return <pre>{this.props.mytext}</pre>; } | |
}); | |
MyComponent = React.createClass({ | |
render: function () { | |
( | |
<ul> | |
{ | |
var self = this; | |
this.props.items.map(function(item){ | |
return ( | |
<li><a href="#" onClick={self.props.handleClick}>{item}</a></li> | |
); | |
}); | |
} | |
</ul> | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment