Last active
November 22, 2015 20:48
-
-
Save heyjohnmurray/6fcbbdaceac95a9b7363 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
/** @jsx React.DOM */ | |
var React = require('react'); | |
var ReactMixin = { | |
componentWillMount: function(){ | |
console.log('will mount'); | |
}, | |
} | |
var App = React.createClass({ | |
render: function(){ | |
return ( | |
<div> | |
<Button txt="this is the button" /> | |
<br /> | |
<Label txt="this is the label" /> | |
</div> | |
) | |
}, | |
}); | |
var Button = React.createClass({ | |
mixins:[ReactMixin], | |
render: function(){ | |
return <button>{this.props.txt}</button> | |
} | |
}); | |
var Label = React.createClass({ | |
mixins:[ReactMixin], | |
render: function(){ | |
return <label>{this.props.txt}</label> | |
} | |
}); | |
module.exports = App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment