Skip to content

Instantly share code, notes, and snippets.

@brianswisher
Created September 28, 2014 04:51
Show Gist options
  • Save brianswisher/5794be49fbf81a8191e1 to your computer and use it in GitHub Desktop.
Save brianswisher/5794be49fbf81a8191e1 to your computer and use it in GitHub Desktop.
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div>
<a href="#"></a>
// React.DOM.a( {href:"#"})
</div>
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div rendered="x" data-rendered="x">
<a href="#"></a>
</div>
// rendered wont render, but data-rendered will:
// React.DOM.div( {rendered:"x", 'data-rendered':"x"},
// React.DOM.a( {href:"#"})
// )
)
}
});
/** @jsx FOO */
React.createClass({
render:function(){
return (
<APP></APP>
// APP(null)
)
}
});
/** @jsx FOO */
React.createClass({
render:function(){
return (
<div></div>
// FOO.div(null)
)
}
});
/** @jsx React.FOO */
React.createClass({
render:function(){
return (
<div></div>
// React.FOO.div(null)
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div></div>
// React.DOM.div(null)
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div rendered="x" data-rendered="x">
<a href="#" onClick={this.update}>
{/* This is a comment */}
this props children
</a>
</div>
// React.DOM.div( {rendered:"x", 'data-rendered':"x"},
// React.DOM.a( {href:"#", onClick:this.update},
// /* This is a comment */
// "this props children"
// )
// )
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div></div>
<a></a>
// React.DOM.div(null)
// <a
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div>
<a></a>
</div>
// React.DOM.div(null,
// React.DOM.a(null)
// )
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div rendered="x" data-rendered="x">
<a href="#">this props children</a>
</div>
// React.DOM.div( {rendered:"x", 'data-rendered':"x"},
// React.DOM.a( {href:"#"}, "this props children")
// )
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div/>
// React.DOM.div(null)
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
var myStyle = {
backgroundColor:'#000',
height:10
}
return (
<div style={myStyle} rendered="x" data-rendered="x">
<a href="#" onClick={this.update}>
this props children
</a>
{i>1 ? 'More than one' : 'one'}
{i>1 && 'More than one'}
</div>
// React.DOM.div( {style:myStyle, rendered:"x", 'data-rendered':"x"},
// React.DOM.a( {href:"#", onClick:this.update},
// "this props children"
// ),
// i>1 ? 'More than one' : 'one',
// i>1 && 'More than one'
// )
)
}
});
/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div rendered="x" data-rendered="x">
<a href="#" onClick={this.update}>
this props children
</a>
{i>1 ? 'More than one' : 'one'}
{i>1 && 'More than one'}
</div>
// React.DOM.div( {rendered:"x", 'data-rendered':"x"},
// React.DOM.a( {href:"#", onClick:this.update},
// "this props children"
// ),
// i>1 ? 'More than one' : 'one',
// i>1 && 'More than one'
// )
)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment