Skip to content

Instantly share code, notes, and snippets.

@namuol
Last active August 29, 2015 14:08
Show Gist options
  • Save namuol/61c5f9690fd20351ced9 to your computer and use it in GitHub Desktop.
Save namuol/61c5f9690fd20351ced9 to your computer and use it in GitHub Desktop.
CoffeeX Syntax Concept (JSX for CoffeeScript)
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>
/** @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