Created
September 28, 2014 04:51
-
-
Save brianswisher/5794be49fbf81a8191e1 to your computer and use it in GitHub Desktop.
Dive deep into JSX: https://egghead.io/lessons/jsx-deep-dive
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
/** @jsx React.DOM */ | |
React.createClass({ | |
render:function(){ | |
return ( | |
<div> | |
<a href="#"></a> | |
// React.DOM.a( {href:"#"}) | |
</div> | |
) | |
} | |
}); |
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
/** @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:"#"}) | |
// ) | |
) | |
} | |
}); |
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
/** @jsx FOO */ | |
React.createClass({ | |
render:function(){ | |
return ( | |
<APP></APP> | |
// APP(null) | |
) | |
} | |
}); |
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
/** @jsx FOO */ | |
React.createClass({ | |
render:function(){ | |
return ( | |
<div></div> | |
// FOO.div(null) | |
) | |
} | |
}); |
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
/** @jsx React.FOO */ | |
React.createClass({ | |
render:function(){ | |
return ( | |
<div></div> | |
// React.FOO.div(null) | |
) | |
} | |
}); |
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
/** @jsx React.DOM */ | |
React.createClass({ | |
render:function(){ | |
return ( | |
<div></div> | |
// React.DOM.div(null) | |
) | |
} | |
}); |
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
/** @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" | |
// ) | |
// ) | |
) | |
} | |
}); |
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
/** @jsx React.DOM */ | |
React.createClass({ | |
render:function(){ | |
return ( | |
<div></div> | |
<a></a> | |
// React.DOM.div(null) | |
// <a | |
) | |
} | |
}); |
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
/** @jsx React.DOM */ | |
React.createClass({ | |
render:function(){ | |
return ( | |
<div> | |
<a></a> | |
</div> | |
// React.DOM.div(null, | |
// React.DOM.a(null) | |
// ) | |
) | |
} | |
}); |
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
/** @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") | |
// ) | |
) | |
} | |
}); |
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
/** @jsx React.DOM */ | |
React.createClass({ | |
render:function(){ | |
return ( | |
<div/> | |
// React.DOM.div(null) | |
) | |
} | |
}); |
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
/** @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' | |
// ) | |
) | |
} | |
}); |
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
/** @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