Skip to content

Instantly share code, notes, and snippets.

@bingeboy
Created April 1, 2016 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bingeboy/02dd246b94a25bcbb9924c42a689d5e3 to your computer and use it in GitHub Desktop.
Save bingeboy/02dd246b94a25bcbb9924c42a689d5e3 to your computer and use it in GitHub Desktop.
react es5
var React = require('react');
var Foo = React.createClass({
/**
* PropTypes
*/
propTypes: {
className: React.PropTypes.string,
},
/**
* Get default props
* @returns {Object} props
*/
getDefaultProps: function () {
return {
};
},
/**
* Get initial state
* @returns {Object} state
*/
getInitialState: function () {
return {
};
},
/**
* Component did mount
* @returns {undefined} undefined
*/
componentDidMount: function () {
},
/**
* Component will mount
* @returns {undefined} undefined
*/
componentWillMount: function () {
},
/**
* Component will receive props
* @param {Object} nextProps - New props
* @returns {undefined} undefined
*/
componentWillReceiveProps: function (nextProps) {
},
/**
* Render component
* @returns {Object} React element
*/
render: function () {
return (
<div>
Foo
</div>
);
}
});
module.exports = Foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment