Last active
August 29, 2015 14:25
-
-
Save AdamBrodzinski/7265268089bd3f39ee89 to your computer and use it in GitHub Desktop.
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
EvenOrOdd = React.createClass({ | |
propTypes: { | |
number: React.PropTypes.number.isRequired | |
}, | |
isEven(num) { | |
return num % 2 === 0; | |
}, | |
render() { | |
var number = this.props.number; | |
var suffix = (this.isEven(number)) ? 'is Even' : 'is Odd'; | |
return ( | |
<div className='EvenOdd'> | |
{number} {suffix} | |
</div> | |
); | |
} | |
}); | |
if (Meteor.isClient) { | |
Meteor.startup(function() { | |
React.render(<EvenOrOdd number={2} />, document.getElementById('app')); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment