Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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