-
-
Save jergason/f85276e1b3f8bbf6f867 to your computer and use it in GitHub Desktop.
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 */ | |
var React = require('react'); | |
var IfThingy = React.createClass({ | |
render: function() { | |
var ifThingy; | |
if (this.props.someVar) { | |
ifThingy = <h1>Some Var Is {this.props.someVar}</h1>; | |
} | |
else { | |
ifThingy = <h1>Some var is falsy :(</h1>; | |
} | |
return <div> | |
{ifThingy} | |
</div> | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since you represent the DOM with js objects, you just use javascript for your control flow. You don't do any icky matching brackets or anything. It's Just JavaScript!