Skip to content

Instantly share code, notes, and snippets.

@heyjohnmurray
Last active November 22, 2015 20:48
Show Gist options
  • Save heyjohnmurray/6fcbbdaceac95a9b7363 to your computer and use it in GitHub Desktop.
Save heyjohnmurray/6fcbbdaceac95a9b7363 to your computer and use it in GitHub Desktop.
/** @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